You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are running into an error upon import, error trace pasted below:
import bitstring
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\<path>\python\3117\test\Lib\site-packages\bitstring\__init__.py", line 197, in <module>
DtypeDefinition('uintle', Bits._setuintle, Bits._getuintle, int, False, uint_bits2chars,
File "C:\<path>\python\3117\test\Lib\site-packages\bitstring\dtypes.py", line 275, in __init__
if self.allowed_lengths:
File "C:\<path>\python\3117\test\Lib\site-packages\bitstring\dtypes.py", line 244, in __len__
return len(self.value)
^^^^^^^^^^^^^^^
OverflowError: Python int too large to convert to C ssize_t
Ah, 32-bit Python. That brings back memories. The fix should be trivial (what could possibly go wrong hard-coding a value for infinity?!) but I'll probably wait a day to see if anything else has broken before releasing a 4.2.1.
Now I just have to work out how to get the CI to target a 32-bit Python....
This should now be fixed in 4.2.1. although I couldn't find a way to add the test on 32-bit Python to the CI, so strictly speaking I haven't tested the fix actually works...
We are running into an error upon import, error trace pasted below:
https://github.com/scott-griffiths/bitstring/blame/main/bitstring/dtypes.py#L230
traced it down to this line when the module attempts to calculate allowed sizes. It works fine on 64 bit python, but the generator expression here:
https://github.com/scott-griffiths/bitstring/blame/main/bitstring/dtypes.py#L231
self.value = range(value[0], infinity, step)
causes the length of
self.value
to exceed the max ssize_t (presumably 4 bytes).The text was updated successfully, but these errors were encountered: