Filipe Laíns <la...@riseup.net> added the comment:

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

----------
nosy: +FFY00

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44262>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to