Skip to content
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

Closed
biniona opened this issue Nov 13, 2024 · 10 comments · May be fixed by #378
Closed

Cannot Instantiate Quart object with Flask==3.1.0 #371

biniona opened this issue Nov 13, 2024 · 10 comments · May be fixed by #378

Comments

@biniona
Copy link

biniona commented Nov 13, 2024

Unable to instantiate Quart object with Flask==3.1.0.

Run the following code from terminal:

pip install quart

Run the following code:

from quart import Quart

Quart(__name__)

Outputs the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../.pyenv/lib/python3.11/site-packages/quart/app.py", line 338, in __init__
    self.add_url_rule(
  File ".../.pyenv/lib/python3.11/site-packages/flask/sansio/scaffold.py", line 47, in wrapper_func
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../.pyenv/lib/python3.11/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'

Output of pip freeze:

aiofiles==24.1.0
blinker==1.9.0
click==8.1.7
Flask==3.1.0
h11==0.14.0
h2==4.1.0
hpack==4.0.0
Hypercorn==0.17.3
hyperframe==6.0.1
itsdangerous==2.2.0
Jinja2==3.1.4
MarkupSafe==3.0.2
priority==2.0.0
Quart==0.19.8
Werkzeug==3.1.3
wsproto==1.2.0

Installing Flask==3.0.0 fixes the issue:

The expected behavior is a successful instantiation of a Quart object.

Environment:

  • Python version: 3.11.3
  • Flask version: 3.1.0
@biniona biniona changed the title Bug in Quart + Flask 3.1.0 Cannot Instantiate Quart App with Flask 3.1.0 Nov 13, 2024
@biniona biniona changed the title Cannot Instantiate Quart App with Flask 3.1.0 Cannot Instantiate Quart object with Flask 3.1.0 Nov 13, 2024
@biniona biniona changed the title Cannot Instantiate Quart object with Flask 3.1.0 Cannot Instantiate Quart object with Flask==3.1.0 Nov 13, 2024
@davidism davidism transferred this issue from pallets/flask Nov 13, 2024
@JamesParrott
Copy link

JamesParrott commented Nov 13, 2024

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:
https://github.com/pallets/flask/blame/bc098406af9537aacc436cb2ea777fbc9ff4c5aa/src/flask/app.py#L208

    default_config = ImmutableDict(
        {
            "DEBUG": None,
            "TESTING": False,
            "PROPAGATE_EXCEPTIONS": None,
            "SECRET_KEY": None,
            "SECRET_KEY_FALLBACKS": None,
            "PERMANENT_SESSION_LIFETIME": timedelta(days=31),
            "USE_X_SENDFILE": False,
            "TRUSTED_HOSTS": None,
            "SERVER_NAME": None,
            "APPLICATION_ROOT": "/",
            "SESSION_COOKIE_NAME": "session",
            "SESSION_COOKIE_DOMAIN": None,
            "SESSION_COOKIE_PATH": None,
            "SESSION_COOKIE_HTTPONLY": True,
            "SESSION_COOKIE_SECURE": False,
            "SESSION_COOKIE_PARTITIONED": False,
            "SESSION_COOKIE_SAMESITE": None,
            "SESSION_REFRESH_EACH_REQUEST": True,
            "MAX_CONTENT_LENGTH": None,
            "MAX_FORM_MEMORY_SIZE": 500_000,
            "MAX_FORM_PARTS": 1_000,
            "SEND_FILE_MAX_AGE_DEFAULT": None,
            "TRAP_BAD_REQUEST_ERRORS": None,
            "TRAP_HTTP_EXCEPTIONS": False,
            "EXPLAIN_TEMPLATE_LOADING": False,
            "PREFERRED_URL_SCHEME": "http",
            "TEMPLATES_AUTO_RELOAD": None,
            "MAX_COOKIE_SIZE": 4093,
            "PROVIDE_AUTOMATIC_OPTIONS": True,
        }
    )

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.

](https://github.com/pallets/quart/blob/ef23e8b063ee0b1ae95ba5828570552685ad89bb/src/quart/app.py#L229C5-L229C20)

    default_config = ImmutableDict(
        {
            "APPLICATION_ROOT": "/",
            "BACKGROUND_TASK_SHUTDOWN_TIMEOUT": 5,  # Second
            "BODY_TIMEOUT": 60,  # Second
            "DEBUG": None,
            "ENV": None,
            "EXPLAIN_TEMPLATE_LOADING": False,
            "MAX_CONTENT_LENGTH": 16 * 1024 * 1024,  # 16 MB Limit
            "MAX_COOKIE_SIZE": 4093,
            "PERMANENT_SESSION_LIFETIME": timedelta(days=31),
            # Replaces PREFERRED_URL_SCHEME to allow for WebSocket scheme
            "PREFER_SECURE_URLS": False,
            "PRESERVE_CONTEXT_ON_EXCEPTION": None,
            "PROPAGATE_EXCEPTIONS": None,
            "RESPONSE_TIMEOUT": 60,  # Second
            "SECRET_KEY": None,
            "SEND_FILE_MAX_AGE_DEFAULT": timedelta(hours=12),
            "SERVER_NAME": None,
            "SESSION_COOKIE_DOMAIN": None,
            "SESSION_COOKIE_HTTPONLY": True,
            "SESSION_COOKIE_NAME": "session",
            "SESSION_COOKIE_PATH": None,
            "SESSION_COOKIE_SAMESITE": None,
            "SESSION_COOKIE_SECURE": False,
            "SESSION_REFRESH_EACH_REQUEST": True,
            "TEMPLATES_AUTO_RELOAD": None,
            "TESTING": False,
            "TRAP_BAD_REQUEST_ERRORS": None,
            "TRAP_HTTP_EXCEPTIONS": False,
        }
    )

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.

@mikeckennedy
Copy link

mikeckennedy commented Nov 13, 2024

Hi all, I'm getting the same issue but with a much simpler code base:

pip install quart

then

import quart
app = quart.Quart(__name__)
print("Success")

Then I get the exception for KeyError as well. It's not a matter of compatibility with Flask directly. It's just broken with the latest update to Flask which comes along for the ride.

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):

quart
flask==3.0.3

@JamesParrott
Copy link

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

FAILED tests/test_app.py::test_host_matching - KeyError: 'PROVIDE_AUTOMATIC_O...
FAILED tests/test_app.py::test_subdomain - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
FAILED tests/test_app.py::test_make_response[None-None-True] - KeyError: 'PRO...
FAILED tests/test_app.py::test_make_response[result1-None-True] - KeyError: '...
FAILED tests/test_app.py::test_make_response[result2-expected2-False] - KeyEr...
FAILED tests/test_app.py::test_make_response[result3-expected3-False] - KeyEr...
FAILED tests/test_app.py::test_make_response[result4-expected4-False] - KeyEr...
FAILED tests/test_app.py::test_make_response[result5-expected5-False] - KeyEr...
FAILED tests/test_app.py::test_make_response[result6-expected6-False] - KeyEr...
FAILED tests/test_app.py::test_make_response[result7-expected7-False] - KeyEr...
FAILED tests/test_app.py::test_make_response[<genexpr>-expected8-False] - Key...
FAILED tests/test_app.py::test_make_response[int-None-True] - KeyError: 'PROV...
FAILED tests/test_app.py::test_app_handle_request_asyncio_cancelled_error - K...
FAILED tests/test_app.py::test_app_handle_websocket_asyncio_cancelled_error
FAILED tests/test_app.py::test_propagation[False-False-False] - KeyError: 'PR...
FAILED tests/test_app.py::test_propagation[True-False-True] - KeyError: 'PROV...
FAILED tests/test_app.py::test_propagation[False-True-True] - KeyError: 'PROV...
FAILED tests/test_app.py::test_propagation[True-True-True] - KeyError: 'PROVI...
FAILED tests/test_app.py::test_test_app - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
FAILED tests/test_asgi.py::test_http_1_0_host_header[headers0-quart] - KeyErr...
FAILED tests/test_asgi.py::test_http_1_0_host_header[headers1-] - KeyError: '...
FAILED tests/test_asgi.py::test_http_completion - KeyError: 'PROVIDE_AUTOMATI...
FAILED tests/test_asgi.py::test_http_request_without_body[request_message0]
FAILED tests/test_asgi.py::test_http_request_without_body[request_message1]
FAILED tests/test_asgi.py::test_websocket_completion - KeyError: 'PROVIDE_AUT...
FAILED tests/test_asgi.py::test_http_path_from_absolute_target - KeyError: 'P...
FAILED tests/test_asgi.py::test_http_path_with_root_path[/app-/ ] - KeyError:...
FAILED tests/test_asgi.py::test_http_path_with_root_path[/-/ ] - KeyError: 'P...
FAILED tests/test_asgi.py::test_http_path_with_root_path[/app/-/] - KeyError:...
FAILED tests/test_asgi.py::test_http_path_with_root_path[/app/2-/2] - KeyErro...
FAILED tests/test_asgi.py::test_websocket_path_from_absolute_target - KeyErro...
FAILED tests/test_asgi.py::test_websocket_path_with_root_path[/app-/ ] - KeyE...
FAILED tests/test_asgi.py::test_websocket_path_with_root_path[/-/ ] - KeyErro...
FAILED tests/test_asgi.py::test_websocket_path_with_root_path[/app/-/] - KeyE...
FAILED tests/test_asgi.py::test_websocket_path_with_root_path[/app/2-/2] - Ke...
FAILED tests/test_asgi.py::test_websocket_accept_connection[scope0-headers0-None-False]
FAILED tests/test_asgi.py::test_websocket_accept_connection[scope1-headers1-abc-False]
FAILED tests/test_asgi.py::test_websocket_accept_connection[scope2-headers2-None-True]
FAILED tests/test_asgi.py::test_websocket_accept_connection[scope3-headers3-None-True]
FAILED tests/test_asgi.py::test_websocket_accept_connection_warns - KeyError:...
FAILED tests/test_asgi.py::test_http_asgi_scope_from_request - KeyError: 'PRO...
FAILED tests/test_background_tasks.py::test_background_task - KeyError: 'PROV...
FAILED tests/test_background_tasks.py::test_lifespan_background_task - KeyErr...
FAILED tests/test_background_tasks.py::test_sync_background_task - KeyError: ...
FAILED tests/test_blueprints.py::test_blueprint_route - KeyError: 'PROVIDE_AU...
FAILED tests/test_blueprints.py::test_blueprint_websocket - KeyError: 'PROVID...
FAILED tests/test_blueprints.py::test_blueprint_url_prefix - KeyError: 'PROVI...
FAILED tests/test_blueprints.py::test_empty_path_with_url_prefix - KeyError: ...
FAILED tests/test_blueprints.py::test_blueprint_template_filter - KeyError: '...
FAILED tests/test_blueprints.py::test_blueprint_error_handler - KeyError: 'PR...
FAILED tests/test_blueprints.py::test_blueprint_method_view - KeyError: 'PROV...
FAILED tests/test_blueprints.py::test_cli_blueprints[named-args0] - KeyError:...
FAILED tests/test_blueprints.py::test_cli_blueprints[None-args1] - KeyError: ...
FAILED tests/test_blueprints.py::test_cli_blueprints[cli_group2-args2] - KeyE...
FAILED tests/test_blueprints.py::test_nesting_url_prefixes[/parent-/child-None-None]
FAILED tests/test_blueprints.py::test_nesting_url_prefixes[/parent-None-None-/child]
FAILED tests/test_blueprints.py::test_nesting_url_prefixes[None-None-/parent-/child]
FAILED tests/test_blueprints.py::test_nesting_url_prefixes[/other-/something-/parent-/child]
FAILED tests/test_blueprints.py::test_nesting_subdomains[None-None-None] - Ke...
FAILED tests/test_blueprints.py::test_nesting_subdomains[parent-None-parent]
FAILED tests/test_blueprints.py::test_nesting_subdomains[None-child-child] - ...
FAILED tests/test_blueprints.py::test_nesting_subdomains[parent-child-child.parent]
FAILED tests/test_blueprints.py::test_nesting_and_sibling - KeyError: 'PROVID...
FAILED tests/test_blueprints.py::test_unique_blueprint_names - KeyError: 'PRO...
FAILED tests/test_blueprints.py::test_nested_blueprint - KeyError: 'PROVIDE_A...
FAILED tests/test_blueprints.py::test_blueprint_renaming - KeyError: 'PROVIDE...
FAILED tests/test_blueprints.py::test_nested_callback_order - KeyError: 'PROV...
FAILED tests/test_ctx.py::test_request_context_match - KeyError: 'PROVIDE_AUT...
FAILED tests/test_ctx.py::test_bad_request_if_websocket_route - KeyError: 'PR...
FAILED tests/test_ctx.py::test_after_this_request - KeyError: 'PROVIDE_AUTOMA...
FAILED tests/test_ctx.py::test_has_request_context - KeyError: 'PROVIDE_AUTOM...
FAILED tests/test_ctx.py::test_has_app_context - KeyError: 'PROVIDE_AUTOMATIC...
FAILED tests/test_ctx.py::test_copy_current_app_context - KeyError: 'PROVIDE_...
FAILED tests/test_ctx.py::test_copy_current_request_context - KeyError: 'PROV...
FAILED tests/test_ctx.py::test_works_without_copy_current_request_context - K...
FAILED tests/test_ctx.py::test_copy_current_websocket_context - KeyError: 'PR...
FAILED tests/test_debug.py::test_debug - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
FAILED tests/test_helpers.py::test_stream_with_context - KeyError: 'PROVIDE_A...
FAILED tests/test_helpers.py::test_send_file_path - KeyError: 'PROVIDE_AUTOMA...
FAILED tests/test_helpers.py::test_send_file_bytes_io - KeyError: 'PROVIDE_AU...
FAILED tests/test_helpers.py::test_send_file_no_mimetype - KeyError: 'PROVIDE...
FAILED tests/test_helpers.py::test_send_file_as_attachment - KeyError: 'PROVI...
FAILED tests/test_helpers.py::test_send_file_as_attachment_name - KeyError: '...
FAILED tests/test_helpers.py::test_send_file_mimetype - KeyError: 'PROVIDE_AU...
FAILED tests/test_helpers.py::test_send_file_last_modified - KeyError: 'PROVI...
FAILED tests/test_helpers.py::test_send_file_last_modified_override - KeyErro...
FAILED tests/test_helpers.py::test_send_file_max_age - KeyError: 'PROVIDE_AUT...
FAILED tests/test_sessions.py::test_secure_cookie_session_interface_open_session
FAILED tests/test_sessions.py::test_secure_cookie_session_interface_save_session
FAILED tests/test_sessions.py::test_secure_cookie_session_interface_save_session_no_modification
FAILED tests/test_sessions.py::test_secure_cookie_session_interface_save_session_no_access
FAILED tests/test_static_hosting.py::test_host_matching - KeyError: 'PROVIDE_...
FAILED tests/test_testing.py::test_methods - KeyError: 'PROVIDE_AUTOMATIC_OPT...
FAILED tests/test_testing.py::test_build_headers_path_and_query_string[/path-query_string0-None-/path-a=b-localhost]
FAILED tests/test_testing.py::test_build_headers_path_and_query_string[/path-query_string1-None-/path-a=b&a=c-localhost]
FAILED tests/test_testing.py::test_build_headers_path_and_query_string[/path?b=c-None-None-/path-b=c-localhost]
FAILED tests/test_testing.py::test_build_headers_path_and_query_string[/path%20-None-None-/path --localhost]
FAILED tests/test_testing.py::test_build_headers_path_and_query_string[/path-None-api-/path--api.localhost]
FAILED tests/test_testing.py::test_build_headers_path_and_query_string_with_query_string_error
FAILED tests/test_testing.py::test_build_headers_path_and_query_string_with_auth
FAILED tests/test_testing.py::test_build_headers_path_and_query_string_headers_defaults[None-expected0]
FAILED tests/test_testing.py::test_build_headers_path_and_query_string_headers_defaults[headers1-expected1]
FAILED tests/test_testing.py::test_remote_addr - KeyError: 'PROVIDE_AUTOMATIC...
FAILED tests/test_testing.py::test_json - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
FAILED tests/test_testing.py::test_form - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
FAILED tests/test_testing.py::test_files - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
FAILED tests/test_testing.py::test_data - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
FAILED tests/test_testing.py::test_query_string - KeyError: 'PROVIDE_AUTOMATI...
FAILED tests/test_testing.py::test_redirect - KeyError: 'PROVIDE_AUTOMATIC_OP...
FAILED tests/test_testing.py::test_cookie_jar - KeyError: 'PROVIDE_AUTOMATIC_...
FAILED tests/test_testing.py::test_redirect_cookie_jar - KeyError: 'PROVIDE_A...
FAILED tests/test_testing.py::test_set_cookie - KeyError: 'PROVIDE_AUTOMATIC_...
FAILED tests/test_testing.py::test_websocket_bad_request - KeyError: 'PROVIDE...
FAILED tests/test_testing.py::test_push_promise - KeyError: 'PROVIDE_AUTOMATI...
FAILED tests/test_testing.py::test_session_transactions - KeyError: 'PROVIDE_...
FAILED tests/test_testing.py::test_with_usage - KeyError: 'PROVIDE_AUTOMATIC_...
FAILED tests/test_testing.py::test_websocket_json - KeyError: 'PROVIDE_AUTOMA...
FAILED tests/test_testing.py::test_middleware - KeyError: 'PROVIDE_AUTOMATIC_...
FAILED tests/test_testing.py::test_auth - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
ERROR tests/test_app.py::test_app_route_exception - KeyError: 'PROVIDE_AUTOMA...
ERROR tests/test_app.py::test_app_before_request_exception - KeyError: 'PROVI...
ERROR tests/test_app.py::test_app_after_request_exception - KeyError: 'PROVID...
ERROR tests/test_app.py::test_app_after_request_handler_exception - KeyError:...
ERROR tests/test_app.py::test_app_session - KeyError: 'PROVIDE_AUTOMATIC_OPTI...
ERROR tests/test_app.py::test_app_session_websocket - KeyError: 'PROVIDE_AUTO...
ERROR tests/test_app.py::test_app_session_websocket_return - KeyError: 'PROVI...
ERROR tests/test_basic.py::test_index[/] - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
ERROR tests/test_basic.py::test_index[/sync/] - KeyError: 'PROVIDE_AUTOMATIC_...
ERROR tests/test_basic.py::test_iri - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
ERROR tests/test_basic.py::test_options - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
ERROR tests/test_basic.py::test_json - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
ERROR tests/test_basic.py::test_implicit_json - KeyError: 'PROVIDE_AUTOMATIC_...
ERROR tests/test_basic.py::test_implicit_json_list - KeyError: 'PROVIDE_AUTOM...
ERROR tests/test_basic.py::test_werkzeug - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
ERROR tests/test_basic.py::test_generic_error - KeyError: 'PROVIDE_AUTOMATIC_...
ERROR tests/test_basic.py::test_url_defaults - KeyError: 'PROVIDE_AUTOMATIC_O...
ERROR tests/test_basic.py::test_not_found_error - KeyError: 'PROVIDE_AUTOMATI...
ERROR tests/test_basic.py::test_make_response_str - KeyError: 'PROVIDE_AUTOMA...
ERROR tests/test_basic.py::test_make_response_response - KeyError: 'PROVIDE_A...
ERROR tests/test_basic.py::test_make_response_errors - KeyError: 'PROVIDE_AUT...
ERROR tests/test_basic.py::test_websocket - KeyError: 'PROVIDE_AUTOMATIC_OPTI...
ERROR tests/test_basic.py::test_websocket_abort - KeyError: 'PROVIDE_AUTOMATI...
ERROR tests/test_basic.py::test_root_path - KeyError: 'PROVIDE_AUTOMATIC_OPTI...
ERROR tests/test_basic.py::test_stream - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
ERROR tests/test_helpers.py::test_make_response - KeyError: 'PROVIDE_AUTOMATI...
ERROR tests/test_helpers.py::test_flash - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
ERROR tests/test_helpers.py::test_flash_category - KeyError: 'PROVIDE_AUTOMAT...
ERROR tests/test_helpers.py::test_flash_category_filter - KeyError: 'PROVIDE_...
ERROR tests/test_helpers.py::test_url_for - KeyError: 'PROVIDE_AUTOMATIC_OPTI...
ERROR tests/test_helpers.py::test_url_for_host_matching - KeyError: 'PROVIDE_...
ERROR tests/test_helpers.py::test_url_for_external - KeyError: 'PROVIDE_AUTOM...
ERROR tests/test_helpers.py::test_url_for_scheme - KeyError: 'PROVIDE_AUTOMAT...
ERROR tests/test_helpers.py::test_url_for_anchor - KeyError: 'PROVIDE_AUTOMAT...
ERROR tests/test_helpers.py::test_url_for_blueprint_relative - KeyError: 'PRO...
ERROR tests/test_helpers.py::test_url_for_root_path - KeyError: 'PROVIDE_AUTO...
ERROR tests/test_sync.py::test_sync_request_context - KeyError: 'PROVIDE_AUTO...
ERROR tests/test_sync.py::test_sync_generator - KeyError: 'PROVIDE_AUTOMATIC_...
ERROR tests/test_templating.py::test_template_render - KeyError: 'PROVIDE_AUT...
ERROR tests/test_templating.py::test_default_template_context - KeyError: 'PR...
ERROR tests/test_templating.py::test_template_context_processors - KeyError: ...
ERROR tests/test_templating.py::test_template_globals - KeyError: 'PROVIDE_AU...
ERROR tests/test_templating.py::test_template_filters - KeyError: 'PROVIDE_AU...
ERROR tests/test_templating.py::test_template_tests - KeyError: 'PROVIDE_AUTO...
ERROR tests/test_templating.py::test_simple_stream - KeyError: 'PROVIDE_AUTOM...
ERROR tests/test_views.py::test_view - KeyError: 'PROVIDE_AUTOMATIC_OPTIONS'
ERROR tests/test_views.py::test_method_view - KeyError: 'PROVIDE_AUTOMATIC_OP...
ERROR tests/test_views.py::test_view_decorators - KeyError: 'PROVIDE_AUTOMATI...
================== 132 failed, 72 passed, 48 errors in 20.01s ==================

@philipjames44
Copy link

Yup, easiest fix is likely just pinning your flask version to 3.0.3 until the default config update is pushed through.

@JamesParrott
Copy link

This issue (along with many others) is fixed by PR #374

@pgjones
Copy link
Member

pgjones commented Nov 14, 2024

Best to pin to 3.0.3 - I want to check the subdomain behaviour before releasing.

@speedpetr
Copy link

I solved this issue by these two lines, if you don't need static_folder:
app = Quart(name, static_folder=None)
app.config["PROVIDE_AUTOMATIC_OPTIONS"] = True

@JamesParrott
Copy link

I solved this issue by these two lines, if you don't need static_folder: app = Quart(name, static_folder=None) app.config["PROVIDE_AUTOMATIC_OPTIONS"] = True

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.

@develerltd
Copy link

develerltd commented Nov 14, 2024

raised in flask's issues - pallets/flask#5642

@davidism
Copy link
Member

Quart 0.19.9 is now available on PyPI.

@pallets pallets deleted a comment from develerltd Nov 14, 2024
@pallets pallets deleted a comment from develerltd Nov 14, 2024
@pallets pallets deleted a comment from marcospgp Nov 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
8 participants