Skip to content

Commit 1ada90d

Browse files
committed
Fix binary mode open() call in _get_file_digest()
Remove incorrect encoding parameter from binary mode open() call. Binary mode ('rb') doesn't accept encoding parameter. This was incorrectly added in PR #24 (CJK encoding fix) which added encoding to all open() calls, but binary mode doesn't accept encoding. Fixes: ValueError: binary mode doesn't take an encoding argument when running lock --update on projects with local file paths.
1 parent 1a1cbed commit 1ada90d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ocebuild/sources/binary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def _get_stream_hash(stream, hash) -> str:
4040

4141
def _get_file_digest(filename, hash) -> str:
4242
"""Gets a digest for a file."""
43-
with open(filename, 'rb', encoding="UTF-8") as file:
43+
with open(filename, 'rb') as file:
4444
hash = _get_stream_hash(file, hash)
4545
return hash
4646

0 commit comments

Comments
 (0)