# Bug report ### Bug description: ```python import gzip gzip.compress(b'') ``` output varies by default, which breaks reproducible builds in cases such as https://github.com/getmoto/moto/blob/fc60bd1c5f6e6184e30a6db8b65059a2855cd28e/setup.py#L28 GNU gzip (since 1.10) defaults to a zero timestamp for compressing stdin. And after year 2106, no mtime could be stored anyway. ### CPython versions tested on: 3.13 ### Operating systems tested on: Linux <!-- gh-linked-prs --> ### Linked PRs * gh-125261 <!-- /gh-linked-prs -->
Activity
pythongh-125260: gzip: let compress mtime default to 0
pythongh-125260: gzip: let compress mtime default to 0
ZeroIntensity commentedon Oct 10, 2024
Per @AA-Turner, I'm marking this as a feature.
pythongh-125260: gzip: let compress mtime default to 0
pythongh-125260: gzip: let compress mtime default to 0
pythongh-125260: gzip: let compress mtime default to 0
gh-125260: Change the default ``gzip.compress()`` mtime to 0 (#125261)
thesamesam commentedon Oct 14, 2024
See also #112346 for the OS field.
Rogdham commentedon May 10, 2025
Should the same change be made in the default for
mtimeparameter inGzipFile.__init__? @bmwiedemann @AA-Turner