-
-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
GzipFile doesn't always ignore None as filename #77219
Comments
The Python documentation states that if the GzipFile can't determine a filename from To reproduce
Result:
This doesn't happen on Python 3.6, where the null filename is handled properly. I've attached a patch file that fixed the issue for me. |
da, would you mind if I add a test and a news entry to your patch and submit it as a Github pull request? |
Yeah that's fine. Thanks! |
Did this make it into 2.7.15? There aren't any release notes for it on the download page like usual. |
It looks like PR 6095 for this issue has not been reviewed or merged yet. The commits for v2.7.15 are here: |
Is there someone who might be in a position to review the PR? It's pretty short. |
The workaround in the current 2.7 is specifying an explicit filename argument: with tempfile.SpooledTemporaryFile() as fd:
with gzip.GzipFile(filename='', mode='wb', fileobj=fd) as gz:
gz.write(b'asdf') |
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: