We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d1d1954 commit 7a8586eCopy full SHA for 7a8586e
2 files changed
Lib/nturl2path.py
@@ -26,7 +26,7 @@ def url2pathname(url):
26
# Skip past extra slash before UNC drive in URL path.
27
url = url[1:]
28
else:
29
- if url[:1] == '/' and url[2:3] in ':|':
+ if url[:1] == '/' and url[2:3] in (':', '|'):
30
# Skip past extra slash before DOS drive in URL path.
31
32
if url[1:2] == '|':
Lib/test/test_urllib.py
@@ -1484,6 +1484,7 @@ def test_pathname2url_nonascii(self):
1484
'test specific to Windows pathnames.')
1485
def test_url2pathname_win(self):
1486
fn = urllib.request.url2pathname
1487
+ self.assertEqual(fn('/'), '\\')
1488
self.assertEqual(fn('/C:/'), 'C:\\')
1489
self.assertEqual(fn("///C|"), 'C:')
1490
self.assertEqual(fn("///C:"), 'C:')
0 commit comments