From: Serhiy Storchaka Date: Sat, 24 Oct 2015 14:39:36 +0000 (+0300) Subject: Issue21160: Correct comments in nturl2path. Patch by Jurko Gospodnetić. X-Git-Tag: v2.7.11rc1~56 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9186a6ac10103eafa2082f5ee90f9390761febf9;p=thirdparty%2FPython%2Fcpython.git Issue21160: Correct comments in nturl2path. Patch by Jurko Gospodnetić. --- diff --git a/Lib/nturl2path.py b/Lib/nturl2path.py index 10ea27280789..9e6eb0d559d7 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 # 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 if not ':' in p: # No drive specifier, just convert slashes and quote the name