]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-105821: Use a raw f-string in test_httpservers.py (GH-105822) (#108576)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 28 Aug 2023 17:44:13 +0000 (10:44 -0700)
committerGitHub <noreply@github.com>
Mon, 28 Aug 2023 17:44:13 +0000 (17:44 +0000)
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

index cdd1bea754a020178cf667f1903e7ffe95a5485d..cfd8a101dcc1c1e202acad4e528358390c6c22fb 100644 (file)
@@ -442,10 +442,10 @@ class SimpleHTTPServerTestCase(BaseTestCase):
     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.