-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
gzip: cannot create file if mtime > 2106-02-07T06:28:15 #133998
Copy link
Copy link
Open
Labels
3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Metadata
Metadata
Assignees
Labels
3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
No status
Status
No status
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:15results 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
MTIMEto 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