Skip to content

gzip.compress output is non-deterministic #125260

Closed
@bmwiedemann

Description

@bmwiedemann

Bug report

Bug description:

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

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions