From c9f9862df8cb9331eadb2ada4af5a06eb26147f5 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 21 Jan 2025 12:15:52 +0200 Subject: [PATCH] test_url.py: handle 3.9 and 3.10 for http://[2a01:5cc0:1:2:3:4] testcase The fix for https://github.com/python/cpython/issues/103848 / CVE-2024-11168 also got backported to 3.9.21 and 3.10.16, so we cannot add that testcase for these versions either. --- tests/test_url.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_url.py b/tests/test_url.py index 319d76c..fdf4ba5 100644 --- a/tests/test_url.py +++ b/tests/test_url.py @@ -420,7 +420,11 @@ def test_safe_url_string_encoding( # (%) are not escaped. f"a://example.com#{FRAGMENT_TO_ENCODE}", } -if sys.version_info < (3, 11, 4): +if ( + sys.version_info < (3, 9, 21) + or (sys.version_info[:2] == (3, 10) and sys.version_info < (3, 10, 16)) + or (sys.version_info[:2] == (3, 10) and sys.version_info < (3, 11, 4)) +): KNOWN_SAFE_URL_STRING_URL_ISSUES.add("http://[2a01:5cc0:1:2:3:4]") # Invalid IPv6