diff --git a/pyproject.toml b/pyproject.toml index 8638c570..3212111b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ tornado = ["tornado>=6.5.0"] gthread = [] setproctitle = ["setproctitle"] http2 = ["h2>=4.1.0"] -fast = ["gunicorn_h1c>=0.6.3"] +fast = ["gunicorn_h1c>=0.6.4"] testing = [ "gevent>=24.10.1", "eventlet>=0.40.3", diff --git a/requirements_test.txt b/requirements_test.txt index 4d26756a..40e28207 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -3,4 +3,4 @@ coverage pytest>=7.2.0 pytest-cov pytest-asyncio -gunicorn_h1c>=0.6.2 +gunicorn_h1c>=0.6.4 diff --git a/tests/conftest.py b/tests/conftest.py index c3824279..f1668590 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -20,6 +20,10 @@ if tests_dir not in sys.path: def http_parser(request): """Parametrize tests over http_parser implementations.""" if request.param == "fast": + # gunicorn_h1c ships as a CPython C extension; it is not reliable + # under PyPy (SIGSEGV observed in CI). Skip the fast parameter there. + if hasattr(sys, "pypy_version_info"): + pytest.skip("gunicorn_h1c not supported on PyPy") gunicorn_h1c = pytest.importorskip("gunicorn_h1c", reason="gunicorn_h1c required") # Require >= 0.6.2 for asgi_headers support if not hasattr(gunicorn_h1c.H1CProtocol, 'asgi_headers'): diff --git a/tests/requests/invalid/rfc9110_field_value_ctl_bel_01.py b/tests/requests/invalid/rfc9110_field_value_ctl_bel_01.py index 4203cfe9..abf559d9 100644 --- a/tests/requests/invalid/rfc9110_field_value_ctl_bel_01.py +++ b/tests/requests/invalid/rfc9110_field_value_ctl_bel_01.py @@ -7,4 +7,3 @@ # appear, to prevent log/response injection and parser confusion. from gunicorn.http.errors import InvalidHeader request = InvalidHeader -python_only = True diff --git a/tests/requests/invalid/rfc9110_field_value_ctl_del_01.py b/tests/requests/invalid/rfc9110_field_value_ctl_del_01.py index cd6cd1aa..f992575c 100644 --- a/tests/requests/invalid/rfc9110_field_value_ctl_del_01.py +++ b/tests/requests/invalid/rfc9110_field_value_ctl_del_01.py @@ -6,4 +6,3 @@ # it must not appear in a field-value. from gunicorn.http.errors import InvalidHeader request = InvalidHeader -python_only = True diff --git a/tests/requests/invalid/rfc9110_trailer_forbidden_cl_01.py b/tests/requests/invalid/rfc9110_trailer_forbidden_cl_01.py index b0f8ccae..05bdea9c 100644 --- a/tests/requests/invalid/rfc9110_trailer_forbidden_cl_01.py +++ b/tests/requests/invalid/rfc9110_trailer_forbidden_cl_01.py @@ -6,4 +6,3 @@ # smuggling vector; origin must reject. from gunicorn.http.errors import InvalidHeaderName request = InvalidHeaderName -python_only = True diff --git a/tests/requests/invalid/rfc9110_trailer_forbidden_host_01.py b/tests/requests/invalid/rfc9110_trailer_forbidden_host_01.py index fe897329..3d747dea 100644 --- a/tests/requests/invalid/rfc9110_trailer_forbidden_host_01.py +++ b/tests/requests/invalid/rfc9110_trailer_forbidden_host_01.py @@ -7,5 +7,3 @@ # Content-Length, Transfer-Encoding). Accepting them enables smuggling. from gunicorn.http.errors import InvalidHeaderName request = InvalidHeaderName -# The C parser (gunicorn_h1c) does not yet enforce this rule. -python_only = True diff --git a/tests/requests/invalid/rfc9110_trailer_forbidden_te_01.py b/tests/requests/invalid/rfc9110_trailer_forbidden_te_01.py index caa2f5ac..d2c4c471 100644 --- a/tests/requests/invalid/rfc9110_trailer_forbidden_te_01.py +++ b/tests/requests/invalid/rfc9110_trailer_forbidden_te_01.py @@ -6,4 +6,3 @@ # and must not be accepted. from gunicorn.http.errors import InvalidHeaderName request = InvalidHeaderName -python_only = True diff --git a/tests/requests/invalid/rfc9112_target_asterisk_non_options_01.py b/tests/requests/invalid/rfc9112_target_asterisk_non_options_01.py index cd5bfe62..a3616620 100644 --- a/tests/requests/invalid/rfc9112_target_asterisk_non_options_01.py +++ b/tests/requests/invalid/rfc9112_target_asterisk_non_options_01.py @@ -7,5 +7,3 @@ # rejected as an ill-formed request-line. from gunicorn.http.errors import InvalidRequestLine request = InvalidRequestLine -# The C parser (gunicorn_h1c) does not yet enforce this rule. -python_only = True diff --git a/tests/requests/invalid/rfc9112_target_authority_non_connect_01.py b/tests/requests/invalid/rfc9112_target_authority_non_connect_01.py index 2a91f311..85bfb56a 100644 --- a/tests/requests/invalid/rfc9112_target_authority_non_connect_01.py +++ b/tests/requests/invalid/rfc9112_target_authority_non_connect_01.py @@ -6,5 +6,3 @@ # the CONNECT method. Any other method carrying it must be rejected. from gunicorn.http.errors import InvalidRequestLine request = InvalidRequestLine -# The C parser (gunicorn_h1c) does not yet enforce this rule. -python_only = True diff --git a/tests/requests/invalid/rfc9112_target_relative_01.py b/tests/requests/invalid/rfc9112_target_relative_01.py index ea6bb9e2..8dd816d2 100644 --- a/tests/requests/invalid/rfc9112_target_relative_01.py +++ b/tests/requests/invalid/rfc9112_target_relative_01.py @@ -7,5 +7,3 @@ # like "foo/bar" matches none of these and must be rejected. from gunicorn.http.errors import InvalidRequestLine request = InvalidRequestLine -# The C parser (gunicorn_h1c) does not yet enforce this rule. -python_only = True