Message259308
It looks like the default has been hard-coded to 9 ever since tarfile was added to Python. The gzip module is also hard-coded to 9 since it was added. If tarfile is changed, maybe gzip should too.
Why would you want to use zlib’s default (apparently 6)? Memory usage or speed perhaps? If we do change the default, maybe it is best to only do it in 3.6. I don’t see it as a bug fix, and there is a chance it could break someone’s code.
To be able to control the compression level, perhaps you can already do it by wrapping the tar stream with GzipFile (untested):
gz_writer = GzipFile(fileobj=raw_writer, mode="wb", compresslevel=...)
tar_writer = tarfile.open(fileobj=gz_writer, mode="w|")
tar_writer.addfile(...)
tar_writer.close()
gz_writer.close()
If the default is changed, it certainly makes sense to add an easy compression level parameter, to be able to restore the old behaviour. |
|
Date |
User |
Action |
Args |
2016-02-01 03:13:43 | martin.panter | set | recipients:
+ martin.panter, Patrik Dufresne |
2016-02-01 03:13:43 | martin.panter | set | messageid: <1454296423.22.0.321330773541.issue26253@psf.upfronthosting.co.za> |
2016-02-01 03:13:43 | martin.panter | link | issue26253 messages |
2016-02-01 03:13:42 | martin.panter | create | |
|