pb icon indicating copy to clipboard operation
pb copied to clipboard

Deprecated and internal werkzeug calls, prevents use on python 3.12

Open applebee1558 opened this issue 1 year ago • 3 comments

There are tons of calls to internal Werkzeug APIs and it prevents use with any newer versions of werkzeug.

applebee1558 avatar Oct 29 '24 20:10 applebee1558

bilbo@localhost ~/pb $ env/bin/python --version
Python 3.12.7
bilbo@localhost ~/pb $ env/bin/python -m pb
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/bilbo/pb/pb/__main__.py", line 29, in <module>
    from werkzeug.serving import run_simple
  File "/home/bilbo/pb/env/lib/python3.12/site-packages/werkzeug/__init__.py", line 151, in <module>
    __import__('werkzeug.exceptions')
  File "/home/bilbo/pb/env/lib/python3.12/site-packages/werkzeug/exceptions.py", line 71, in <module>
    from werkzeug.wrappers import Response
  File "/home/bilbo/pb/env/lib/python3.12/site-packages/werkzeug/wrappers.py", line 27, in <module>
    from werkzeug.http import HTTP_STATUS_CODES, \
  File "/home/bilbo/pb/env/lib/python3.12/site-packages/werkzeug/http.py", line 1148, in <module>
    from werkzeug.datastructures import Accept, HeaderSet, ETags, Authorization, \
  File "/home/bilbo/pb/env/lib/python3.12/site-packages/werkzeug/datastructures.py", line 16, in <module>
    from collections import Container, Iterable, MutableSet
ImportError: cannot import name 'Container' from 'collections' (/usr/lib/python3.12/collections/__init__.py)

It seems Werkzeug is importing from collections, but it should be importing from collections.abc.

buhman avatar Oct 31 '24 10:10 buhman

The next issue, urllib3 is broken:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/bilbo/pb/env/lib/python3.12/site-packages/urllib3/__init__.py", line 8, in <module>
    from .connectionpool import (
  File "/home/bilbo/pb/env/lib/python3.12/site-packages/urllib3/connectionpool.py", line 11, in <module>
    from .exceptions import (
  File "/home/bilbo/pb/env/lib/python3.12/site-packages/urllib3/exceptions.py", line 2, in <module>
    from .packages.six.moves.http_client import (
ModuleNotFoundError: No module named 'urllib3.packages.six.moves'

buhman avatar Oct 31 '24 11:10 buhman

@applebee1558 does a885f8a work for you?

buhman avatar Oct 31 '24 11:10 buhman