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.

Author FFY00
Recipients FFY00, yellowhat
Date 2021-05-29.23:38:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1622331540.28.0.333798764423.issue44262@roundup.psfhosted.org>
In-reply-to
Content
I modified the script to keep the both Python generated tarballs and ran diffoscope, which presents the issue very clearly:


$ diffoscope py.gz py2.gz
--- py.gz
+++ py2.gz
├── filetype from file(1)
│ @@ -1 +1 @@
│ -gzip compressed data, was "py", last modified: Sat May 29 23:24:02 2021, max compression
│ +gzip compressed data, was "py2", last modified: Sat May 29 23:24:03 2021, max compression


The issue is that by default, when writing gzip files, the mtime will be set for the last modification. This is helpful, but might be unwanted in some cases. You can change the mtime as shown in [1].

Now let's take a look at the difference between the file Python generated and the one the `tar` command generated.


$ diffoscope py.gz tar_a0.tgz
--- py.gz
+++ tar_a0.tgz
├── filetype from file(1)
│ @@ -1 +1 @@
│ -gzip compressed data, was "py", last modified: Sat May 29 23:24:02 2021, max compression
│ +gzip compressed data, from Unix


It seems like it generates the same output here because the `tar` command does not set any mtime on the archive by default.


[1] https://github.com/FFY00/trampolim/blob/dbd03c90eaa2cc732e1a01268786b491dc872fb7/trampolim/_build.py#L354
History
Date User Action Args
2021-05-29 23:39:00FFY00setrecipients: + FFY00, yellowhat
2021-05-29 23:39:00FFY00setmessageid: <1622331540.28.0.333798764423.issue44262@roundup.psfhosted.org>
2021-05-29 23:39:00FFY00linkissue44262 messages
2021-05-29 23:38:59FFY00create