From d3fd6a9012c01989f3d0d64831142dfb1fdd887b Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 13 Jun 2023 07:47:43 +0200 Subject: [PATCH 142/N] tests: fix invalid escape sequence fallout from https://github.com/python/cpython/pull/104067 --- 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 66ab064..6b93c91 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -420,10 +420,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, f'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, f'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.