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
tarfile module does not correctly choose compression algorithms #67609
Comments
The command "python -m tarfile -c test.tar.bz2 test/" should create a file that is compressed by bzip2, fix it by prepending a dot to the keys of the dictionary |
Thank you for your patch. Could you provide tests? |
yes just wanna know is there a standard way to get file type by libmagic ? |
No need to use libmagic. tarfile.TarFile.gzopen() should fail if the file is not gzipped tar file. There CLI tests in Lib/test/test_tarfile.py. New test should create tar file with file name that ends with the '.gz' extension and check that it can be open and read with gzopen(). |
Oh, I can use it. |
Here is the tests. |
In general LGTM, but I have added few nitpicks on Rietveld. |
Attached factored patch for tests. It looks much better. :) |
s/factored/refactored/ |
New changeset 2a06379f6562 by Serhiy Storchaka in branch '3.4': New changeset 5b70eb1cfad0 by Serhiy Storchaka in branch 'default': |
Thank you for your contribution. |
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: