Menu ▾ ▴

#10 Formatting bugs

open
nobody
None
5
2007-11-06
2007-11-06
Anonymous
No

While using pyXLwriter I found the following DeprecatedWarnings:
C:\Python25\Lib\site-packages\pyXLWriter\OLEWriter.py:135: DeprecationWarning: struct integer overflow masking is deprecated

unknown3 = pack("<H", -2)

C:\Python25\Lib\site-packages\pyXLWriter\OLEWriter.py:135: DeprecationWarning: 'H' format requires 0 <= number <= 65535

unknown3 = pack("<H", -2)

C:\Python25\Lib\site-packages\pyXLWriter\OLEWriter.py:141: DeprecationWarning: struct integer overflow masking is deprecated

sbd_startblock = pack("<L", -2)

C:\Python25\Lib\site-packages\pyXLWriter\OLEWriter.py:142: DeprecationWarning: struct integer overflow masking is deprecated

unknown7 = pack("<LLL", 0x00, -2 ,0x00)

C:\Python25\Lib\site-packages\pyXLWriter\OLEWriter.py:143: DeprecationWarning: struct integer overflow masking is deprecated

unused = pack("<L", -1)

C:\Python25\Lib\site-packages\pyXLWriter\OLEWriter.py:205: DeprecationWarning: struct integer overflow masking is deprecated

pps_prev = pack("<L", -1) #0x44

C:\Python25\Lib\site-packages\pyXLWriter\OLEWriter.py:206: DeprecationWarning: struct integer overflow masking is deprecated

pps_next = pack("<L", -1) #0x48

C:\Python25\Lib\site-packages\pyXLWriter\OLEWriter.py:213: DeprecationWarning: struct integer overflow masking is deprecated

pps_sb = pack("<L", sb) #0x74

C:\Python25\Lib\site-packages\pyXLWriter\OLEWriter.py:207: DeprecationWarning: struct integer overflow masking is deprecated

pps_dir = pack("<L", dir) #0x4c

C:\Python25\Lib\site-packages\pyXLWriter\OLEWriter.py:168: DeprecationWarning: struct integer overflow masking is deprecated

marker = pack("<L", -3)

C:\Python25\Lib\site-packages\pyXLWriter\OLEWriter.py:169: DeprecationWarning: struct integer overflow masking is deprecated

end_of_chain = pack("<L", -2)

C:\Python25\Lib\site-packages\pyXLWriter\OLEWriter.py:170: DeprecationWarning: struct integer overflow masking is deprecated

unused = pack("<L", -1)

(Hopefully this is readable, but i also included them in a seperate file)

These warnings occur because it is trying to format a negative value into an unsigned value. So the solution is to change the capital ('L' or 'H') to lowercase ('l' or 'h') because the lowercase means signed format.

I changed these values on my local copy and they seem to work so I thought I post them here as well. Do not know for sure if this is the right place...

Discussion

  • Nobody/Anonymous

    bug report

     

Log in to post a comment.