-
-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot Instantiate Quart
object with Flask==3.1.0
#371
Comments
3.1.0
Quart
App with Flask 3.1.0
Quart
App with Flask 3.1.0
Quart
object with Flask 3.1.0
Quart
object with Flask 3.1.0
Quart
object with Flask==3.1.0
I've reproduced this (on Windows - but I don't think the environment or Python version is important). The missing key ("PROVIDE_AUTOMATIC_OPTIONS ") was added after Flask 3.0.0, by the time Flask 3.1.0 was released (as would be expected). It appears in a hardcoded dict of defaults:
There's a separate hard coded dict in Quart (the defaults in sansio/app.py are empty) which needs updating to be compatible with Flask 3.1.0.
A single missing key error is trivial enough to fix, but Quart's second hardcoded dict being incompatible with Flask 3.1.0's, is the real problem, here. PROVIDE_AUTOMATIC_OPTIONS is not the only missing key in Quart's default_config either. If Quart intends to be compatible with Flask, is there any reason quart.app.Quart.default_config can't use Flask's defaults Flask, and override which ever ones it needs to? Otherwise in future, Quart will inevitably encounter similar issues to this one, just with some other missing key, the next time Flask adds a new setting, as its hardcoded dict must manually be kept current with Flask's, which is sub-optimal in terms of all our valuable developer time, to say the least. |
Hi all, I'm getting the same issue but with a much simpler code base:
then import quart
app = quart.Quart(__name__)
print("Success") Then I get the exception for In case it'll help anyone, this is a temporary fix that worked for me in my requirements files (didn't have Flask at all in the unpinned version):
|
Now that Flask 3.1.0 is released, this issue is now causing a large number of test failures for Quart in CI. Great spot Alek @biniona ! https://github.com/pallets/quart/actions/runs/11826264489/job/32951848198
|
Yup, easiest fix is likely just pinning your flask version to 3.0.3 until the default config update is pushed through. |
This issue (along with many others) is fixed by PR #374 |
Best to pin to 3.0.3 - I want to check the subdomain behaviour before releasing. |
I solved this issue by these two lines, if you don't need static_folder: |
If you're happy to manually set this, and all the missing configuration variables, that's fine. But Quart should really work out of the box, with minimal configuration required. |
raised in flask's issues - pallets/flask#5642 |
Quart 0.19.9 is now available on PyPI. |
Unable to instantiate
Quart
object withFlask==3.1.0
.Run the following code from terminal:
Run the following code:
Outputs the following error:
Output of
pip freeze
:Installing
Flask==3.0.0
fixes the issue:The expected behavior is a successful instantiation of a
Quart
object.Environment:
3.11.3
3.1.0
The text was updated successfully, but these errors were encountered: