[BUG] 0.15rc2: DeprecationWarning: struct integer overflow masking is deprecated

Jari Aalto+usenet jari.aalto at cante.net
Sun Apr 1 10:06:19 BST 2007


* Tue 2007-03-27 John Arbash Meinel <john AT arbash-meinel.com>
>>>> /usr/lib/python2.5/site-packages/bzrlib python -Werror /usr/bin/bzr status dirstate.py
>>>> struct integer overflow masking is deprecated
>>>> size : <type 'long'> 107912
>>>> mtime: <type 'float'> 1174919444.0
>>>> ctime: <type 'float'> 1174919444.0
>>>> dev  : <type 'long'> 1085651769
>>>> ino  : <type 'long'> 4336604776193321356
>>>> mode : <type 'int'> 33188
>>>> modified:
>>>>   dirstate.py
>>> Well, it is pretty clear that you have 64-bit inodes, and those aren't
>>> going to fit in a 32-bit struct.pack.
>
> Can you confirm if the warning goes away with this change:
> === modified file 'bzrlib/dirstate.py'
> --- bzrlib/dirstate.py  2007-03-26 12:26:11 +0000
> +++ bzrlib/dirstate.py  2007-03-27 19:58:29 +0000
> @@ -2369,6 +2369,6 @@
>      # well within the noise margin
>
>      # base64.encode always adds a final newline, so strip it off
> -    return _encode(_pack('>llllll'
> +    return _encode(_pack('>LLLLLL'
>          , st.st_size, int(st.st_mtime), int(st.st_ctime)
> -        , st.st_dev, st.st_ino, st.st_mode))[:-1]
> +        , st.st_dev, st.st_ino & 0xFFFFFFFF, st.st_mode))[:-1]

Confirmed. Works like a charm.

Thanks,
Jari




More information about the bazaar mailing list