◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
10 changes: 9 additions & 1 deletion Lib/test/test_urllib2.py
Original file line number Diff line number Diff line change
@@ -1851,9 +1851,17 @@ def test_parse_proxy(self):
('ftp', 'joe', 'password', 'proxy.example.com')),
# Test for no trailing '/' case
('http://joe:password@proxy.example.com',
('http', 'joe', 'password', 'proxy.example.com'))
]

for tc, expected in parse_proxy_test_cases:
self.assertEqual(_parse_proxy(tc), expected)

Expand Down
6 changes: 5 additions & 1 deletion Lib/urllib/request.py
Original file line number Diff line number Diff line change
@@ -773,7 +773,11 @@ def _parse_proxy(proxy):
raise ValueError("proxy URL with no authority: %r" % proxy)
# We have an authority, so for RFC 3986-compliant URLs (by ss 3.
# and 3.3.), path is empty or starts with '/'
end = r_scheme.find("/", 2)
if end == -1:
end = None
authority = r_scheme[2:end]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Toggle all file notes Toggle all file annotations