jobcore/python/python-3.11.5-raw_fstring.patch
2023-08-29 19:21:19 +03:00

34 lines
1.6 KiB
Diff

From ed749be3aab081ce4e5d54e0273b96bdea02983f Mon Sep 17 00:00:00 2001
From: "Miss Islington (bot)"
<31488909+miss-islington@users.noreply.github.com>
Date: Mon, 28 Aug 2023 10:44:13 -0700
Subject: [PATCH] [3.11] gh-105821: Use a raw f-string in test_httpservers.py
(GH-105822) (#108576)
gh-105821: Use a raw f-string in test_httpservers.py (GH-105822)
Use a raw f-string in test_httpservers.py
(cherry picked from commit 09ce8c3b48f940eb8865330f029b8069854c3106)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
---
Lib/test/test_httpservers.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index cdd1bea754a02..cfd8a101dcc1c 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -442,10 +442,10 @@ def test_undecodable_filename(self):
def test_undecodable_parameter(self):
# sanity check using a valid parameter
response = self.request(self.base_url + '/?x=123').read()
- self.assertRegex(response, f'listing for {self.base_url}/\?x=123'.encode('latin1'))
+ self.assertRegex(response, rf'listing for {self.base_url}/\?x=123'.encode('latin1'))
# now the bogus encoding
response = self.request(self.base_url + '/?x=%bb').read()
- self.assertRegex(response, f'listing for {self.base_url}/\?x=\xef\xbf\xbd'.encode('latin1'))
+ self.assertRegex(response, rf'listing for {self.base_url}/\?x=\xef\xbf\xbd'.encode('latin1'))
def test_get_dir_redirect_location_domain_injection_bug(self):
"""Ensure //evil.co/..%2f../../X does not put //evil.co/ in Location.