scott-griffiths / bitstring

A Python module to help you manage your bits
https://bitstring.readthedocs.io/en/stable/index.html
MIT License
404 stars 68 forks source link

Bitstring 4.0.0 doesn't work with python 3.7 #240

Closed alexjacobson95 closed 1 year ago

alexjacobson95 commented 1 year ago

First off, thanks for this awesome package, it's a huge help to me. But I wanted to let you know that the latest 4.0.0 release of bitstring seems to have broken 3.7 support. Looks like SupportsIndex doesn't exist in the typing module for python 3.7, and thus errors out on import. I tried bitstring 3.1.9 and had no issues. Example below:

>>> import bitstring
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/d/Alex/Documents/repos/bitstring/bitstring.py", line 75, in <module>
    from typing import Generator, SupportsIndex, Tuple, Union, List, Iterable, Any, Optional, Iterator, Pattern, Dict,\
ImportError: cannot import name 'SupportsIndex' from 'typing' (/home/alex/.pyenv/versions/3.7.15/lib/python3.7/typing.py)
>>>

Looks like SupportsIndex was added in python 3.8: https://docs.python.org/3.8/library/typing.html#typing.SupportsIndex

scott-griffiths commented 1 year ago

Oops. Looks like my test harness was broken! Thanks for letting me know - I'll fix today.

scott-griffiths commented 1 year ago

Yep, looks like my Python3.7 unit test runner accidentally got upgraded to use Python 3.11. :(

Bastian-Krause commented 1 year ago

@scott-griffiths Do you plan to make a bug fix release for this?

scott-griffiths commented 1 year ago

@Bastian-Krause Yep. Already done. Latest is 4.0.1 which (fingers crossed) should be good this time!

Bastian-Krause commented 1 year ago

@scott-griffiths Thanks a lot!