init of class GzipFile has mtime as an optional argument, but open() function does not.
When using open(), mtime will always be set to the current time and so far there was no way of fixing it to a specific timestamp.
In case two people would tar.gz the same file and take its sha, the shas would be different. With an option to fix the mtime, they could have a unique sha.
PR containing code change and the tests is already ready.
Activity
ellaellela commented on Apr 4, 2022
init of class GzipFile has mtime as an optional argument, but open() function does not.
When using open(), mtime will always be set to the current time and so far there was no way of fixing it to a specific timestamp.
In case two people would tar.gz the same file and take its sha, the shas would be different. With an option to fix the mtime, they could have a unique sha.
PR containing code change and the tests is already ready.
Remove timestamp from gzip to achieve r-b
Remove timestamp from gzip to achieve r-b
Remove timestamp from gzip to achieve r-b
gh-91372: Add mtime to gzip.open() (GH-32310)
pythongh-91372: Add mtime to gzip.open() (pythonGH-32310)
pythongh-91372: Add mtime to gzip.open() (pythonGH-32310)