]> granicus.if.org Git - python/commitdiff
Issue21160: Correct comments in nturl2path. Patch by Jurko Gospodnetić.
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 24 Oct 2015 14:39:36 +0000 (17:39 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 24 Oct 2015 14:39:36 +0000 (17:39 +0300)
Lib/nturl2path.py

index 5a6d44a6593a1e9b2654e67c2e7e6ea4e65e894d..36dc7658870e9695f5864246d54a5ceef8133d67 100644 (file)
@@ -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