[MERGE] python2.6 compatibility

Forest Bond forest at alittletooquiet.net
Fri Sep 12 20:49:02 BST 2008


Hi,

On Fri, Sep 12, 2008 at 02:33:09PM -0500, John Arbash Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Someone was reporting some incompatibilities about bzr + python2.6
> 
> I don't have python2.6 around to test with, but I at least addressed his
> direct issues.
> 
> One of them is just bogus on our part (passing something to a base class
> that doesn't allow it.) The other is something that we seem to import,
> but that we don't actually need.

[...]

> === modified file 'bzrlib/tuned_gzip.py'
> --- bzrlib/tuned_gzip.py	2008-04-24 07:22:53 +0000
> +++ bzrlib/tuned_gzip.py	2008-09-12 19:24:17 +0000
> @@ -21,7 +21,7 @@
>  
>  # make GzipFile faster:
>  import gzip
> -from gzip import U32, LOWU32, FEXTRA, FCOMMENT, FNAME, FHCRC
> +from gzip import LOWU32, FEXTRA, FCOMMENT, FNAME, FHCRC
>  import sys
>  import struct
>  import zlib
> @@ -207,7 +207,8 @@
>          crc32, isize = struct.unpack("<LL", self._gzip_tail)
>          # note that isize is unsigned - it can exceed 2GB
>          if crc32 != U32(self.crc):

You're no longer importing U32.

> -            raise IOError, "CRC check failed %d %d" % (crc32, U32(self.crc))
> +            raise IOError, "CRC check failed %d %d" % (crc32,
> +                self.crc & 0xFFFFFFFFL)
>          elif isize != LOWU32(self.size):
>              raise IOError, "Incorrect length of data produced"

-Forest
-- 
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080912/306ceca7/attachment.pgp 


More information about the bazaar mailing list