-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gzip: cannot create file if mtime > 2106-02-07T06:28:15
#133998
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
Comments
It is consistent with the specification, I am +1 for setting it to |
I'm at the PyCon US sprints right now, and I decided to give this issue a shot. I have made a pull request. |
@adang1345 In the future please ask before using someones idea, they may want to open the pr themselves. |
@adang1345 , in this case I'd be 108 before this issue could cause any noticeable problems. |
From the changelog for the GNU gzip 1.9 (2018-01-07):
So replacing the mtime outside of the valid range with 0 looks the most preferable solution. |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
We had a VM where ntp went very wonky and ended up thinking it was the year 2141!
Trying to write a gzip file with the system clock greater than
2106-02-07T06:28:15
results in a struct error because we tried to cram a 64-bit int into a 32 bit field (which won't work).I wouldn't expect the gzip module to explode in this case, I'd expect it to set the
MTIME
to 0.RFC 1952 (if that's at all relevant these days) states
MWE
Only tested this on macOS on 3.13.2, but from a cursory glance, the mtime handling hasn't changed in over a decade.
Proposed Patch
I'd naïvely fix it with this patch
CPython versions tested on:
3.13
Operating systems tested on:
macOS
Linked PRs
The text was updated successfully, but these errors were encountered: