summaryrefslogtreecommitdiffstats
path: root/Lib/dos-8x3/macurl2p.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-05-08 17:31:04 (GMT)
committerGuido van Rossum <guido@python.org>2000-05-08 17:31:04 (GMT)
commitaad6761ccea28e0a0da6761570b18adc72e01c37 (patch)
tree731b55d5648f08e1bc755bcace1f836413cd8aae /Lib/dos-8x3/macurl2p.py
parent0b095bc0929fb43157019c50e3e680a29ec94a65 (diff)
downloadcpython-aad6761ccea28e0a0da6761570b18adc72e01c37.zip
cpython-aad6761ccea28e0a0da6761570b18adc72e01c37.tar.gz
cpython-aad6761ccea28e0a0da6761570b18adc72e01c37.tar.bz2
The usual...
Diffstat (limited to 'Lib/dos-8x3/macurl2p.py')
-rwxr-xr-xLib/dos-8x3/macurl2p.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/dos-8x3/macurl2p.py b/Lib/dos-8x3/macurl2p.py
index 7d273bc..c971eda 100755
--- a/Lib/dos-8x3/macurl2p.py
+++ b/Lib/dos-8x3/macurl2p.py
@@ -1,5 +1,6 @@
-"""Mac specific module for conversion between pathnames and URLs.
-Do not import directly, use urllib instead."""
+"""Macintosh-specific module for conversion between pathnames and URLs.
+
+Do not import directly; use urllib instead."""
import string
import urllib
@@ -13,6 +14,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