gh-82907: Document mtime=0 for reproducible tarfile gzip output#150269
Conversation
tarfile.open() already writes a fixed zero timestamp in the gzip header when mtime=0 is passed, on both the 'w:gz' and 'w|gz' paths, producing output that does not depend on the archive creation time. Document this special value, matching the existing wording in the gzip module docs.
|
I noticed the |
Documentation build overview
|
serhiy-storchaka
left a comment
There was a problem hiding this comment.
LGTM.
Such small docs changes do not need a NEWS entry.
|
Thanks @omkar-334 for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
Sorry, @omkar-334 and @serhiy-storchaka, I could not cleanly backport this to |
|
Sorry, @omkar-334 and @serhiy-storchaka, I could not cleanly backport this to |
|
GH-150271 is a backport of this pull request to the 3.15 branch. |
tarfile.open()takes anmtimeargument for gzip writing, and passingmtime=0writes a zero timestamp into the gzip header, so the output doesn't depend on when the archive was created.That value wasn't mentioned in the docs, even though the gzip module documents the same thing. This adds a sentence to the
tarfile.open()docs, matching the gzip wording.this pr fixes #82907 and affects only docs
cc @serhiy-storchaka
gzip -n(omit timestamp and original file name) to tarfile module's auto-compression support #82907