From 2d2ea1b431f9cf58aa8ac45052bd2e4cf2502a5c Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Thu, 14 Apr 2011 13:16:30 +0800 Subject: Fix Issue11474 - fix url2pathname() handling of '/C|/' on Windows --- Lib/nturl2path.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Lib/nturl2path.py') diff --git a/Lib/nturl2path.py b/Lib/nturl2path.py index ce9c3d36db..511dcec5d6 100644 --- a/Lib/nturl2path.py +++ b/Lib/nturl2path.py @@ -27,9 +27,12 @@ def url2pathname(url): drive = comp[0][-1].upper() components = comp[1].split('/') path = drive + ':' - for comp in components: + for comp in components: if comp: path = path + '\\' + urllib.parse.unquote(comp) + # Issue #11474 - handing url such as |c/| + if path.endswith(':') and url.endswith('/'): + path += '\\' return path def pathname2url(p): -- cgit v1.2.1