Message306065
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. |
|
Date |
User |
Action |
Args |
2017-11-10 23:46:22 | martin.panter | set | recipients:
+ martin.panter, jonash, randombit |
2017-11-10 23:46:22 | martin.panter | set | messageid: <1510357582.05.0.213398074469.issue31526@psf.upfronthosting.co.za> |
2017-11-10 23:46:22 | martin.panter | link | issue31526 messages |
2017-11-10 23:46:21 | martin.panter | create | |
|