This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add equivalent of `gzip -n` (omit timestamp and original file name) to tarfile module's auto-compression support
Type: Stage:
Components: Versions:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: zwol
Priority: normal Keywords:

Created on 2019-11-06 20:12 by zwol, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg356151 - (view) Author: Zack Weinberg (zwol) * Date: 2019-11-06 20:12
Recent versions of the gzip command-line utility have an option `-n` which causes it to omit the FNAME field of the gzip file header, and write out the MTIME field as zero.  Both of these properties are desirable when constructing reproducible build artifacts (see https://reproducible-builds.org/ ).

Right now, it's possible to get the `gzip` module to do the same thing (it's not documented, but it's possible; see bug 38725) but, as far as I can tell, if you use `tarfile`'s "w:gz" or "w|gz" modes you will always get a timestamp and a filename in the output.  Please add `w[:|]gzn`, or something like that, that behaves as-if the output were piped through `gzip -n`.

(It might make sense to remove the manual creation of a gzip file header from the tarfile module at the same time; it looks like this code predates the addition of the gzip module to the stdlib.)
History
Date User Action Args
2022-04-11 14:59:22adminsetgithub: 82907
2019-11-06 20:12:04zwolcreate