From 458123bd18e663919f441a69e01e8c76d5b01a98 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sat, 24 Oct 2015 17:39:36 +0300 Subject: [PATCH] =?UTF-8?q?Issue21160:=20Correct=20comments=20in=20nturl2p?= =?UTF-8?q?ath.=20=20Patch=20by=20Jurko=20Gospodneti=C4=87.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lib/nturl2path.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Lib/nturl2path.py b/Lib/nturl2path.py index 5a6d44a6593..36dc7658870 100644 --- a/Lib/nturl2path.py +++ b/Lib/nturl2path.py @@ -4,9 +4,11 @@ def url2pathname(url): """OS-specific conversion from a relative URL of the 'file' scheme to a file system path; not recommended for general use.""" # e.g. - # ///C|/foo/bar/spam.foo - # becomes - # C:\foo\bar\spam.foo + # ///C|/foo/bar/spam.foo + # and + # ///C:/foo/bar/spam.foo + # become + # C:\foo\bar\spam.foo import string, urllib.parse # Windows itself uses ":" even in URLs. url = url.replace(':', '|') @@ -39,9 +41,9 @@ def pathname2url(p): """OS-specific conversion from a file system path to a relative URL of the 'file' scheme; not recommended for general use.""" # e.g. - # C:\foo\bar\spam.foo + # C:\foo\bar\spam.foo # becomes - # ///C|/foo/bar/spam.foo + # ///C:/foo/bar/spam.foo import urllib.parse if not ':' in p: # No drive specifier, just convert slashes and quote the name