[Python-checkins] gh-105821: Use a raw f-string in test_httpservers.py (#105822)

pablogsal webhook-mailer at python.org
Thu Jun 15 06:48:24 EDT 2023


https://github.com/python/cpython/commit/09ce8c3b48f940eb8865330f029b8069854c3106
commit: 09ce8c3b48f940eb8865330f029b8069854c3106
branch: main
author: Pablo Galindo Salgado <Pablogsal at gmail.com>
committer: pablogsal <Pablogsal at gmail.com>
date: 2023-06-15T10:48:01Z
summary:

gh-105821: Use a raw f-string in test_httpservers.py (#105822)

Use a raw f-string in test_httpservers.py

files:
M Lib/test/test_httpservers.py

diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index cdd1bea754a0..cfd8a101dcc1 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.



More information about the Python-checkins mailing list