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 martin.panter
Recipients jonash, martin.panter, randombit
Date 2017-11-10.23:46:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510357582.05.0.213398074469.issue31526@psf.upfronthosting.co.za>
In-reply-to
Content
Perhaps you can compress the tar file using the “gzip.GzipFile” class. It accepts a custom “mtime” parameter (see Issue 4272, added in 2.7 and 3.1+):

>>> gztar = BytesIO()
>>> tar = GzipFile(fileobj=gztar, mode="w", mtime=0)
>>> tarfile.open(fileobj=tar, mode="w|").close()
>>> tar.close()
>>> gztar.getvalue().hex()
'1f8b08000000000002ffedc1010d000000c2a0f74f6d0e37a00000000000000000008037039ade1d2700280000'

However, “tarfile.open” accepts a “compresslevel” argument for two of the compressors, so you could argue it is okay to add another argument to pass to the gzip compressor.
History
Date User Action Args
2017-11-10 23:46:22martin.pantersetrecipients: + martin.panter, jonash, randombit
2017-11-10 23:46:22martin.pantersetmessageid: <1510357582.05.0.213398074469.issue31526@psf.upfronthosting.co.za>
2017-11-10 23:46:22martin.panterlinkissue31526 messages
2017-11-10 23:46:21martin.pantercreate