We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cff17b9 commit 599a782Copy full SHA for 599a782
src/sagemaker/workflow/utilities.py
@@ -52,7 +52,7 @@ def hash_file(path: str) -> str:
52
BUF_SIZE = 65536 # read in 64KiB chunks
53
md5 = hashlib.md5()
54
if path.lower().startswith("file://"):
55
- path = unquote(urlparse(path).path.strip('/'))
+ path = unquote(urlparse(path).path)
56
with open(path, "rb") as f:
57
while True:
58
data = f.read(BUF_SIZE)
tests/unit/sagemaker/workflow/test_utilities.py
@@ -27,5 +27,5 @@ def test_hash_file():
27
def test_hash_file_uri():
28
with tempfile.NamedTemporaryFile() as tmp:
29
tmp.write("hashme".encode())
30
- hash = hash_file(f"file://{tmp.name}")
+ hash = hash_file(f"file:///{tmp.name}")
31
assert hash == "d41d8cd98f00b204e9800998ecf8427e"
0 commit comments