Skip to content

Conversation

@superbsky
Copy link

Load manifest safely in binary mode with optional bz2 decompression.

Open manifest_file using 'rb' to prevent automatic UTF-8 decoding of compressed data.

Call bz2.decompress() only when the filename ends with .bz2; otherwise pass the raw bytes through.

Decode the resulting bytes to UTF-8 before json.loads().

Update CLI help string to reflect support for both .json and .json.bz2.

Fixes:

UnicodeDecodeError when a .bz2 file was read in text mode.

TypeError when bz2.decompress() was called on an already-decoded .json file.

Load manifest safely in binary mode with optional bz2 decompression.

Open manifest_file using 'rb' to prevent automatic UTF-8 decoding of compressed data.

Call bz2.decompress() only when the filename ends with .bz2; otherwise pass the raw bytes through.

Decode the resulting bytes to UTF-8 before json.loads().

Update CLI help string to reflect support for both .json and .json.bz2.

Fixes:

UnicodeDecodeError when a .bz2 file was read in text mode.

TypeError when bz2.decompress() was called on an already-decoded .json file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant