kutsurak / python-bitstring

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

bytes: parsing not working in 3.11 #135

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What's the problem? (If this is a feature request then feel free to delete
all the questions and just say what you want!)

Using the following string in an unpack call:
'bytes:3'
Causes the bitstring library to think it is unpacking 192 bits instead of 24.  
Issue is that the 'bytes:' portion that multiplies the numeric times 8 happens 
twice: once in tokenparser (line 615-616) and then again in _unpack (lines 
2329-2330)

What is the expected output? What do you see instead?

Had existing code running against 3.0.2 just fine.  Setup a new installation 
against 3.11 and ran into the problem (ReadError stating I was reading past the 
end of the buffer).  Debugged it from there

Which version of bitstring are you using (bitstring.__version__), which
version of Python (e.g. 2.7, 3.2) and what platform
(Linux, Windows, etc.)
See above.  

Please provide any additional information below.

Original issue reported on code.google.com by jseabl...@gmail.com on 12 Apr 2013 at 1:57

GoogleCodeExporter commented 9 years ago
Oops, yes I broke this when fixing Issue 122. One work-around is to go back to 
version 3.0.2, but I should get it fixed very soon. Thanks for telling me.

Original comment by dr.scott...@gmail.com on 12 Apr 2013 at 11:37

GoogleCodeExporter commented 9 years ago
Fixed in revision 977.  
If you don't want to wait for a release the change is trivial to patch 
yourself, or you can just grab revision 977 off the trunk (not generally 
recommended, but it should be fine in this case) - 
https://python-bitstring.googlecode.com/svn-history/r977/trunk/bitstring.py

Original comment by dr.scott...@gmail.com on 12 Apr 2013 at 2:51

GoogleCodeExporter commented 9 years ago
Issue 136 has been merged into this issue.

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