Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepend does strange things when coming from bytes object #141

Closed
GoogleCodeExporter opened this issue Apr 11, 2015 · 2 comments
Closed

Comments

@GoogleCodeExporter
Copy link

What's the problem?
If I generate a BitArray from a bytes object i get a strange bahaviour of 
prepend:

>>> arr = BitArray(bytes = b'}i\x01\x1d0\x00\x00\x06\x80\x00', length=9, 
offset=27)
>>> arr
BitArray('0b111010011')
>>> arr.prepend(bits)
>>> arr.bin
'11111111111111111111111100000011'

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

If i do the same thing coming from binary there is no problem:
>>> arr = BitArray('0b111010011')
>>> bits = BitArray('0b1')
>>> bits *= 23
>>> arr.prepend(bits)
>>> arr.bin
'11111111111111111111111111010011'

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.)

bitstring: 3.1.2
Python: 3.3.4
Arch Linux

Original issue reported on code.google.com by gritzer....@gmail.com on 17 Feb 2014 at 9:26

@GoogleCodeExporter
Copy link
Author

Thanks, yes that's quite reproducible and is certainly a problem. I will fix it 
in the next version (probably quite soon).  

Original comment by dr.scott...@gmail.com on 4 Mar 2014 at 10:31

  • Changed state: Accepted
  • Added labels: Priority-High

@GoogleCodeExporter
Copy link
Author

Fixed in r.988. A bitstring 3.1.3 release should appear soon...

Original comment by dr.scott...@gmail.com on 4 Mar 2014 at 1:16

  • Changed state: Verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant