Skip to content

Fails to import with werkzeug 3.0 #28

Closed

Description

@mweinelt

This is a heads-up that werkzeug 3.0 was released a few hours ago and httpbin fails on import.

Looks like the relevant change is in here: pallets/werkzeug#2619

httpbin> Traceback (most recent call last):
httpbin>   File "<string>", line 1, in <module>
httpbin>   File "<string>", line 1, in <lambda>
httpbin>   File "/nix/store/mlzs555x59i8vk160d2yr683mwcacscc-python3-3.11.5/lib/python3.11/importlib/__init__.py", line 126, in import_module
httpbin>     return _bootstrap._gcd_import(name[level:], package, level)
httpbin>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
httpbin>   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
httpbin>   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
httpbin>   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
httpbin>   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
httpbin>   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
httpbin>   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
httpbin>   File "/nix/store/wckwd80x7b1fnpkyngcf45rq4lz997w4-python3.11-httpbin-0.10.1/lib/python3.11/site-packages/httpbin/__init__.py", line 3, in <module>
httpbin>     from .core import *
httpbin>   File "/nix/store/wckwd80x7b1fnpkyngcf45rq4lz997w4-python3.11-httpbin-0.10.1/lib/python3.11/site-packages/httpbin/core.py", line 35, in <module>
httpbin>     from werkzeug.http import parse_authorization_header
httpbin> ImportError: cannot import name 'parse_authorization_header' from 'werkzeug.http' (/nix/store/mg6vcsnplj56nyjlzzjph2wxrsc9449n-python3.11-werkzeug-3.0.0/lib/python3.11/site-packages/werkzeug/http.py)

Activity

  1. jeffvanvoorst commented on Oct 5, 2023

    @jeffvanvoorst

    helpers.py and core.py need to use werkzeug.datastructures.Authorization.from_header( ). Should work for werkzeug 2.3+.

    I have a tentative fix if a PR will be considered.

  2. mgorny commented on Oct 5, 2023

    @mgorny

    I have a tentative fix if a PR will be considered.

    I'm sure it will, please make one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions