reuse-tool icon indicating copy to clipboard operation
reuse-tool copied to clipboard

'ABCMeta' object is not subscriptable on Python 3.8.10

Open ale5000-git opened this issue 1 year ago • 3 comments

On Python 3.8.10 I get: TypeError: 'ABCMeta' object is not subscriptable

I have fixed it by replacing: if sys.version_info >= (3, 8) or TYPE_CHECKING: with: if sys.version_info >= (3, 9) or TYPE_CHECKING: in all places, but I'm not sure what is the correct minimum version.

ale5000-git avatar Sep 06 '22 11:09 ale5000-git

Can you give a full traceback to reproduce this error?

carmenbianca avatar Sep 06 '22 13:09 carmenbianca

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\Scripts\reuse.exe\__main__.py", line 4, in <module>
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\reuse\_main.py", line 15, in <module>
    from . import (
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\reuse\download.py", line 18, in <module>
    from ._util import (
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\reuse\_util.py", line 28, in <module>
    from debian.copyright import Copyright
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\debian\copyright.py", line 58, in <module>
    from debian._deb822_repro import (
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\debian\_deb822_repro\__init__.py", line 166, in <module>
    from debian._deb822_repro.parsing import (
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\debian\_deb822_repro\parsing.py", line 12, in <module>
    from debian._deb822_repro._util import (combine_into_replacement, BufferingIterator,
  File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\debian\_deb822_repro\_util.py", line 120, in <module>
    _bufferingIterator_Base = collections.abc.Iterator[T]
TypeError: 'ABCMeta' object is not subscriptable

ale5000-git avatar Sep 06 '22 14:09 ale5000-git

Was fixed upstream almost two weeks ago (https://salsa.debian.org/python-debian-team/python-debian/-/commit/7b71e7cdb5e8f637fa139af1d378a029884e6f09) - a simple bump in the requirements.txt would actually fix the issue IMO - btw the version referenced there is almost 2 years old :flushed:


edit: it seems to be that the issue was introduced with python-debian 0.1.45, so a downgrade to a version below should help. And sadly the fix mentioned above isn't released yet, so if the latest version is required only pip with git support would help

priv-kweihmann avatar Sep 18 '22 15:09 priv-kweihmann