Code using tuned_gzip may throw writing crc with Python 2.7
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Martin Packman |
Bug Description
On Python 2.7 the following tests fail:
bt.
bt.
bt.
bt.
Errors are all along the lines of:
Traceback (most recent call last):
File ".\bzrlib\
% (sha1sum,))
File ".\bzrlib\
File "...\python-
File "...\python-
error: integer out of range for 'L' format code
The immediate cause is struct hasn't liked packing negative numbers into unsigned integers for a while, started issuing a deprecation warning in 2.5 and later just an error like the above.
This is only happening because of a later change to the gzip module, which tuned_gzip overrides some but not all parts of. For some reason a long standing fixup in the close method was removed and instead `& 0xffffffffL` was added after every call to zlib.crc32 instead:
<http://
<http://
I'm still not completely sure why this is being hit in 2.7 but apparently not in 2.6 where that change initially landed.
Repeating a whine, this bug need never have happened, had some plans been followed:
>bzr blame --all --long bzrlib\
1641.1.1 <email address hidden> 20060407 | """Bzrlib specific gzip tunings. We plan to feed these to the upstream gzip."""
Related branches
- John A Meinel: Approve
-
Diff: 35 lines (+17/-0)2 files modifiedbzrlib/tests/test_tuned_gzip.py (+9/-0)
bzrlib/tuned_gzip.py (+8/-0)
Changed in bzr: | |
assignee: | nobody → Martin [gz] (gz) |
milestone: | none → 2.3b1 |
status: | Confirmed → Fix Released |
tags: |
added: python27 removed: python2.7 |
Getting things upstream is not always trivial, and often gets forgotten. (And even if it *does* land, we can't use it because we support back to 2.4 which isn't updated anymore)