kutsurak / python-bitstring

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

Problems with large bitstrings in 32-bit Python 2.x. #96

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There are a number of places in the code where xrange is used where it could 
exceed sys.maxsize in 32-bit Python. Sometimes it is if the number of bits is > 
2^31, sometimes the number of bytes has to be larger than this, but both are 
quite possible.

Should only affect Python 2.x.

for example:

>>> a = Bits(2**32)
>>> b = ~a
OverflowError: Python int too large to convert to C long

Original issue reported on code.google.com by dr.scott...@gmail.com on 14 Jul 2010 at 5:03

GoogleCodeExporter commented 9 years ago
Fixed the problem with invert (rev 762). The other xrange problems should only 
occur when over 2GB of data needs to be processed. This is probably quite a 
rare case and is difficult to test for (simply because all the tests take ages!)

Leaving the defect open for now, but it might be a case of adding a known issue 
for 32-bit Python 2.

Original comment by dr.scott...@gmail.com on 21 Jul 2010 at 6:31

GoogleCodeExporter commented 9 years ago

Original comment by dr.scott...@gmail.com on 21 Jul 2010 at 6:31

GoogleCodeExporter commented 9 years ago
Not fixing - this is a minor problem and 32-bit Python 2 is a shrinking segment.

Original comment by dr.scott...@gmail.com on 8 Mar 2013 at 1:31