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 Patrik Dufresne, martin.panter
Date 2016-02-01.03:13:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454296423.22.0.321330773541.issue26253@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-02-01 03:13:43martin.pantersetrecipients: + martin.panter, Patrik Dufresne
2016-02-01 03:13:43martin.pantersetmessageid: <1454296423.22.0.321330773541.issue26253@psf.upfronthosting.co.za>
2016-02-01 03:13:43martin.panterlinkissue26253 messages
2016-02-01 03:13:42martin.pantercreate