summaryrefslogtreecommitdiff
path: root/Lib/nturl2path.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2011-04-14 12:54:35 +0800
committerSenthil Kumaran <orsenthil@gmail.com>2011-04-14 12:54:35 +0800
commita99b761972c60b4c98e2c08233faa7b915e4104c (patch)
tree50a57b8d714d260749980292d68df6ac257258f2 /Lib/nturl2path.py
parent7f9d2ead346902bbe3da15969605b3bcd4ea06eb (diff)
downloadcpython-git-a99b761972c60b4c98e2c08233faa7b915e4104c.tar.gz
Fix Issue11474 - url2pathname() handling of '/C|/' on Windows
Diffstat (limited to 'Lib/nturl2path.py')
-rw-r--r--Lib/nturl2path.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/nturl2path.py b/Lib/nturl2path.py
index 29ea80f9d9..10ea272807 100644
--- a/Lib/nturl2path.py
+++ b/Lib/nturl2path.py
@@ -25,11 +25,14 @@ def url2pathname(url):
error = 'Bad URL: ' + url
raise IOError, error
drive = comp[0][-1].upper()
- components = comp[1].split('/')
path = drive + ':'
- for comp in components:
+ components = comp[1].split('/')
+ for comp in components:
if comp:
path = path + '\\' + urllib.unquote(comp)
+ # Issue #11474: url like '/C|/' should convert into 'C:\\'
+ if path.endswith(':') and url.endswith('/'):
+ path += '\\'
return path
def pathname2url(p):