Skip to content

Commit 7d098c9

Browse files
committed
Open file in binary mode when computing hash
1 parent 97e9395 commit 7d098c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

salt/spm/pkgfiles/local.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def hash_file(path, hashobj, conn=None):
184184
if os.path.isdir(path):
185185
return ""
186186

187-
with salt.utils.files.fopen(path, "r") as f:
187+
with salt.utils.files.fopen(path, "rb") as f:
188188
hashobj.update(salt.utils.stringutils.to_bytes(f.read()))
189189
return hashobj.hexdigest()
190190

0 commit comments

Comments
 (0)