summaryrefslogtreecommitdiffstats
path: root/Lib/macurl2path.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-06-01 14:36:56 (GMT)
committerGuido van Rossum <guido@python.org>1999-06-01 14:36:56 (GMT)
commit116b31bed74776dd93a0dc4f24f383f7a954796b (patch)
tree4f1ba2ae4a4b8c893a19e17c5ce089e0d31cf6e7 /Lib/macurl2path.py
parentfa8c3eab79043d7dddafe00242730257db638849 (diff)
downloadcpython-116b31bed74776dd93a0dc4f24f383f7a954796b.zip
cpython-116b31bed74776dd93a0dc4f24f383f7a954796b.tar.gz
cpython-116b31bed74776dd93a0dc4f24f383f7a954796b.tar.bz2
Jack Jansen's patch to support file:///path/file/name URL syntax.
Diffstat (limited to 'Lib/macurl2path.py')
-rw-r--r--Lib/macurl2path.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/macurl2path.py b/Lib/macurl2path.py
index 7d273bc..4c43d21 100644
--- a/Lib/macurl2path.py
+++ b/Lib/macurl2path.py
@@ -13,6 +13,11 @@ def url2pathname(pathname):
tp = urllib.splittype(pathname)[0]
if tp and tp <> 'file':
raise RuntimeError, 'Cannot convert non-local URL to pathname'
+ # Turn starting /// into /, an empty hostname means current host
+ if pathname[:3] == '///':
+ pathname = pathname[2:]
+ elif pathname[:2] == '//':
+ raise RuntimeError, 'Cannot convert non-local URL to pathname'
components = string.split(pathname, '/')
# Remove . and embedded ..
i = 0