Skip to content

flask==2.2.4 incompatible with werkzeug==3.1.3 #5652

@ranaprathapthanneeru

Description

@ranaprathapthanneeru

I use flask==2.2.4 for my project and when I install flask, it pulls any werkzeug>=2.2.2 (which is the default behaviour). After werkzeug==3.1.3 got released on 8 Nov, 2024, flask pulls the latest version of it. With this new version of werkzeug, while executing unit tests, I get an error saying module 'werkzeug' has no attribute '__version__'

A small example to reproduce the issue:
(myenv) root@6426d8424cca:~# python3
Python 3.9.16 (main, Sep 2 2024, 12:46:28)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
">>> from flask import Flask
">>> app = Flask(name)
">>> my_test_client = app.test_client()
Traceback (most recent call last):
File "", line 1, in
File "/root/myenv/lib/python3.9/site-packages/flask/app.py", line 1252, in test_client
return cls( # type: ignore
File "/root/myenv/lib/python3.9/site-packages/flask/testing.py", line 116, in init
"HTTP_USER_AGENT": f"werkzeug/{werkzeug.version}",
AttributeError: module 'werkzeug' has no attribute 'version'

I shouldn't be seeing any error like above.

Environment:

  • Python version: 3.9.16
  • Flask version: 2.2.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions