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 edulix
Recipients edulix
Date 2014-08-07.11:02:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1407409352.24.0.421737248606.issue22163@psf.upfronthosting.co.za>
In-reply-to
Content
I think I have found a small typo-bug in tarfile.py, that seems to
be present in cpython upstream, which makes tarfile compression slower.
The issue can be seen here, in line 415 [1] of tarfile.py:

        self.cmp = self.zlib.compressobj(9, self.zlib.DEFLATED,
                                            -self.zlib.MAX_WBITS,
                                            self.zlib.DEF_MEM_LEVEL,
                                            0)

The minus sign doesn't make sense to me, because zlib.MAX_WBITS is 15,
and according to the documentation [2] wbits is by default 15 and
"This should be an integer from 8 to 15. Higher values give better
compression, but use more memory". -15 is not even in range. So I guess the expected value should be the zlib default, 15. Or maybe another value, but it should at least be in range. 

I marked it as "performance" type bug as this only really affects performance.

I might have gotten it all wrong and it's fine the way it is, but I thought it'd be best to report it, as it looked fishy to me.

--
[1] http://hg.python.org/cpython/file/94d0e842b9ea/Lib/tarfile.py#l415
[2] https://docs.python.org/3.4/library/zlib.html#zlib.compressobj
History
Date User Action Args
2014-08-07 11:02:32edulixsetrecipients: + edulix
2014-08-07 11:02:32edulixsetmessageid: <1407409352.24.0.421737248606.issue22163@psf.upfronthosting.co.za>
2014-08-07 11:02:32edulixlinkissue22163 messages
2014-08-07 11:02:31edulixcreate