Jack Jansen's patch to support file:///path/file/name URL syntax.

This commit is contained in:
Guido van Rossum 1999-06-01 14:36:56 +00:00
parent fa8c3eab79
commit 116b31bed7
1 changed files with 5 additions and 0 deletions

View File

@ -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