[IronPython] Critical bug in binascii

Aude Espesset aude at microsoft.com
Fri Jun 2 18:18:53 CEST 2006


Hi all,
 
I'm trying to read some fields in a binary file and convert them to hexadecimal numbers. The conversion seems to work most of the time but not always. It doesn't crash, it just returns the wrong answer:-(

Here's an example:

*

In CPython :

>>> import binascii

>>> a = '\x00\x00\x10\x00'

>>> b = binascii.b2a_hex(a)

>>> b

'00001000'

>>> int(b,16)

4096  

  

The same thing in IronPython (beta 7):

>>> import binascii

>>> a = '\x00\x00\x10\x00'

>>> b = binascii.b2a_hex(a)

>>> b

'00100'

>>> int(b,16)

256

 

Aude




More information about the Ironpython-users mailing list