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
test_zoneinfo fails when lzma module is unavailable #85543
Comments
Issue: How I build and ran the tests: Test traceback: |
Note: |
I got this error as well. Since lzma is needed to decode the test data the ImportError can be captured to skip the test in setUpModule [0] like other test module setup with similar approach for required cases. I am adding easy tag. Feel free to retriage this if the test data need to be encoded in a different format for the test to support platforms that don't have lzma. try: [0]
|
I'm creating a pull request that implements the suggestion by xtreak. |
I think for now skipping the tests when lzma is missing is the easiest thing, though another option would be to drop the compression on the input test data so that the tests don't depend on lzma. Taking a look at the data files, it looks like we get around 50% compression using either lzma or gzip, but the uncompressed file is only 32k to start with: $ du -b tests/data/*
31054 tests/data/zoneinfo_data.json
15127 tests/data/zoneinfo_data.json.gz
12895 tests/data/zoneinfo_data.json.lz We're also currently using the "fat" binaries that $ du -b tests/data/*
8297 tests/data/zoneinfo_data_slim.json.gz
7750 tests/data/zoneinfo_data_slim.json.lz
15551 tests/data/zoneinfo_data_unc_slim.json So we're still looking at ~2:1 compression for both gzip and lzma, but the overall file size is 50% of what it was to start with. The biggest downside to this is that the way the "slim" binaries work is that once a rule repeats indefinitely, I think we can go with the following course of action (3 or 4 different PRs):
If we ever decide that we really want the compression again, I assume that |
Im still trying to get the hang of the PR workflow so my apologies in advance. I closed the first PR by accident. I made the mistake of including a commit for another issue as well as the commit for this issue. When trying to clean up, I reverted back too far and Github closed the PR. I have submitted another PR that imports the lzma library as follows: from test.support.import_helper import import_module
lzma = import_module('lzma') Let me know if something still does not look right. I'll have some time this evening to work it out. |
make test
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: