From 5d02c1c5b98492e93d32598afa32f8748f5c449b Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Wed, 28 Oct 2026 11:39:33 -0700 Subject: [PATCH] gh-56689 test case to cover for windows proxy_bypass misbehaving with trailing ; entries on windows. Issue was fixed in GH-115210 Co-Authored by Claude Code. --- Lib/test/test_urllib2.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 7efbc81a16096a6..3e4fec6e3e84744 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -1625,6 +1625,14 @@ def test_winreg_proxy_bypass(self): "expect to bypass intranet address '%s'" % host) + # empty entries (e.g. a trailing ';') must not match every host + for proxy_override in ("www.example.com;", ";", " ; ", + "www.example.com;;*.example.net"): + self.assertFalse(proxy_bypass("www.python.org", proxy_override), + "expected empty entry in %r not to bypass" + % proxy_override) + self.assertTrue(proxy_bypass("www.example.com", "www.example.com;")) + @unittest.skipUnless(sys.platform == 'darwin', "only relevant for OSX") def test_osx_proxy_bypass(self): bypass = {