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.

Title: sdist --format=gztar should use (equivalent of) `gzip -n`
Type: Stage: resolved
Components: Distutils Versions:
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: dstufft, eric.araujo, steve.dower, zwol
Priority: normal Keywords:

Created on 2019-11-06 20:14 by zwol, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (5)
msg356152 - (view) Author: Zack Weinberg (zwol) * Date: 2019-11-06 20:14
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 ).

An sdist tarball is a build artifact and it should be created as reproducibly as possible.  In particular, --format=gztar should behave as-if `gzip -n` were in use.  (The stdlib's gzip module can produce output equivalent to what gzip -n does, but this is not currently documented nor is it accessible via `tarfile`.  Both of those should be easy fixes.  See bug 38725 and bug 38726.)
msg379343 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2020-10-22 20:41
Distutils isn’t used much (directly), I think this should be reported to the tools that create sdists, such as setuptools and flit.
msg379352 - (view) Author: Zack Weinberg (zwol) * Date: 2020-10-22 21:20
The code that needs to be changed is in distutils, setuptools just calls into it. I haven't checked flit but I expect it does the same.
msg379357 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2020-10-22 21:31
setuptools has its own copy of distutils now.

flit is independent of distutils.
msg386234 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:04
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at
Date User Action Args
2022-04-11 14:59:22adminsetgithub: 82908
2021-02-03 18:04:23steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386234

resolution: out of date
stage: resolved
2020-10-22 21:31:41eric.araujosetmessages: + msg379357
2020-10-22 21:20:03zwolsetmessages: + msg379352
2020-10-22 20:41:26eric.araujosetmessages: + msg379343
2020-10-22 20:40:05eric.araujounlinkissue29708 dependencies
2020-10-22 20:39:28eric.araujolinkissue29708 dependencies
2019-11-06 20:14:38zwolcreate