Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Quart on the new flask 3.1.0 release, and PROVIDE_AUTOMATIC_OPTIONS #380

Answered by davidism
afurgal asked this question in Q&A
Discussion options

Was pulling my hair out today to track down a new error on quart / hypercorn related to PROVIDE_AUTOMATIC_OPTIONS.

Managed to track it down to the recent 3.1.0 release of flask, and @pgjones looks like you fixed but have not released this already. 2473a04

I'm new to quart so be kind, and probably have missed a lot of crossover an nuance.

This was my stack trace, and have fixed now by putting flask==3.0.3 before quart in my package installs. Are there any other workarounds which might be a bit more elegant, or different ways to configure options?

(.venv) ~/PycharmProjects/Fluid Website Discovery/backend git:[main]
hypercorn -c hypercorn_config.toml fluid_discovery_api:run_app
Starting the Quart application...
Process SpawnProcess-1:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/adam/PycharmProjects/Fluid Website Discovery/.venv/lib/python3.12/site-packages/hypercorn/asyncio/run.py", line 187, in asyncio_worker
app = load_application(config.application_path, config.wsgi_max_body_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/adam/PycharmProjects/Fluid Website Discovery/.venv/lib/python3.12/site-packages/hypercorn/utils.py", line 110, in load_application
module = import_module(import_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1381, in _gcd_import
File "", line 1354, in _find_and_load
File "", line 1325, in _find_and_load_unlocked
File "", line 929, in _load_unlocked
File "", line 994, in exec_module
File "", line 488, in _call_with_frames_removed
File "/Users/adam/PycharmProjects/Fluid Website Discovery/backend/fluid_discovery_api.py", line 57, in
app = create_app() # Initialize Quart app
^^^^^^^^^^^^
File "/Users/adam/PycharmProjects/Fluid Website Discovery/backend/fluid_discovery_api.py", line 30, in create_app
app = Quart(name)
^^^^^^^^^^^^^^^
File "/Users/adam/PycharmProjects/Fluid Website Discovery/.venv/lib/python3.12/site-packages/quart/app.py", line 338, in init
self.add_url_rule(
File "/Users/adam/PycharmProjects/Fluid Website Discovery/.venv/lib/python3.12/site-packages/flask/sansio/scaffold.py", line 47, in wrapper_func
return f(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/adam/PycharmProjects/Fluid Website Discovery/.venv/lib/python3.12/site-packages/flask/sansio/app.py", line 641, in add_url_rule
if "OPTIONS" not in methods and self.config["PROVIDE_AUTOMATIC_OPTIONS"]:
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'

You must be logged in to vote

It was a temporary incompatibility with Flask 3.1. The release fixing this is literally being built and uploaded right now.

Replies: 2 comments 1 reply

Comment options

It was a temporary incompatibility with Flask 3.1. The release fixing this is literally being built and uploaded right now.

You must be logged in to vote
1 reply
Comment options

Quart 0.19.9 is now available on PyPI.

Answer selected by afurgal
Comment options

Excellent, thank you @davidism

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /