summaryrefslogtreecommitdiff
path: root/Lib/nturl2path.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2005-12-26 22:53:56 +0000
committerGeorg Brandl <georg@python.org>2005-12-26 22:53:56 +0000
commit300edbbdc9c33cc337519807c61060d1c0ed9909 (patch)
tree749991d4a300de27c3bf16158de838a4c32258ec /Lib/nturl2path.py
parent8ade6f0aa479d8ac1abc90a157d70abc3e53e529 (diff)
downloadcpython-300edbbdc9c33cc337519807c61060d1c0ed9909.tar.gz
Bug #649974: make docstrings for url2pathname consistent
Diffstat (limited to 'Lib/nturl2path.py')
-rw-r--r--Lib/nturl2path.py29
1 files changed, 12 insertions, 17 deletions
diff --git a/Lib/nturl2path.py b/Lib/nturl2path.py
index 2ced9a91c5..31064044e7 100644
--- a/Lib/nturl2path.py
+++ b/Lib/nturl2path.py
@@ -1,14 +1,12 @@
"""Convert a NT pathname to a file URL and vice versa."""
def url2pathname(url):
- r"""Convert a URL to a DOS path.
-
- ///C|/foo/bar/spam.foo
-
- becomes
-
- C:\foo\bar\spam.foo
- """
+ """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
import string, urllib
# Windows itself uses ":" even in URLs.
url = url.replace(':', '|')
@@ -35,15 +33,12 @@ def url2pathname(url):
return path
def pathname2url(p):
- r"""Convert a DOS path name to a file url.
-
- C:\foo\bar\spam.foo
-
- becomes
-
- ///C|/foo/bar/spam.foo
- """
-
+ """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
+ # becomes
+ # ///C|/foo/bar/spam.foo
import urllib
if not ':' in p:
# No drive specifier, just convert slashes and quote the name