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

Jari Aalto+usenet jari.aalto at cante.net
Mon Mar 26 15:40:17 BST 2007


* Mon 2007-03-26 John Arbash Meinel <john AT arbash-meinel.com>
>
>>>>  /usr/lib/python2.5/site-packages/bzrlib/dirstate.py:2302: DeprecationWarning: struct integer overflow masking is deprecated
>>>>   , st.st_dev, st.st_ino, st.st_mode))[:-1]
>>> struct.pack('>LLLLLL') instead of struct.pack('>llllll')
>
> And the change the lines around "struct.pack()" to catch the exception
> with something like:
>
> try:
>     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]
> except Exception, e:
>     print e
>     print 'size: %s %s' % (type(st.st_size), st.st_size)
>     print 'mtime: %s %s' % (type(st.st_mtime), st.st_mtime)
>     ...
>     # The same for all parameters, so we can figure out what it is
>     # complaining about
>
> python -Werror /usr/bin/bzr ci -m "..."

Here is catch of: "return _encode(_pack('>llllll'"

Jari

/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




More information about the bazaar mailing list