kutsurak / python-bitstring

Automatically exported from code.google.com/p/python-bitstring
0 stars 0 forks source link

unpack for bytes code fails #136

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version 3.1.1 using python 2.7.2

BitArray( bytes="ABCDEF" )
b.unpack( 'bytes:6' )

  File "bitstring.py", line 2262, in unpack
    return self._readlist(fmt, 0, **kwargs)[0]
  File "bitstring.py", line 2293, in _readlist
    value, pos = self._readtoken(name, pos, length)
  File "bitstring.py", line 1993, in _readtoken
    raise ReadError("Reading off the end of the data.")

length is set to 384 (6*8*8) in line 2293.  My guess is that the byte length is 
getting multiplied twice somewhere.

Original issue reported on code.google.com by ted.drain@gmail.com on 16 Apr 2013 at 6:05

GoogleCodeExporter commented 9 years ago
Thanks, this has now been fixed (see Issue 135) - maybe I shouldn't close 
issues until the fix has been released... I'll probably do a 3.1.2 release in 
the next few days. Cheers.

Original comment by dr.scott...@gmail.com on 16 Apr 2013 at 8:51

GoogleCodeExporter commented 9 years ago
Fixed in 3.1.2 release.

Original comment by dr.scott...@gmail.com on 18 Apr 2013 at 4:54