Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asdf expects that block compression label bytes are valid ascii #1683

Open
braingram opened this issue Nov 14, 2023 · 0 comments
Open

asdf expects that block compression label bytes are valid ascii #1683

braingram opened this issue Nov 14, 2023 · 0 comments

Comments

@braingram
Copy link
Contributor

Here is one example:

if compression == comp.label.decode("ascii"):

The standard doesn't mention that these 4 bytes should be limited to the ascii range:
https://asdf-standard.readthedocs.io/en/1.0.3/file_layout.html#block-header

Modifying the LzmaCompressor used in test_compression_with_extension to use label `b"lzm\255" results in a failure at:

labels += [comp.label.decode("ascii")]

UnicodeDecodeError: 'ascii' codec can't decode byte 0xad in position 3: ordinal not in range(128)

I can see the benefit of having these be just ascii (they are human readable when the file is opened with a text editor). If this restriction is ok than the standard should be updated to reflect that these bytes must be ascii.

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

No branches or pull requests

1 participant