From: Sjoerd Mullender

The filename to URL conversion didn't properly quote special
characters.
The URL to filename didn't properly unquote special chatacters.
This commit is contained in:
Guido van Rossum 1999-03-12 14:31:10 +00:00
parent f61bbc8182
commit 367ac80d3b
2 changed files with 17 additions and 23 deletions

View file

@ -38,16 +38,9 @@ elif os.name == 'nt':
from nturl2path import url2pathname, pathname2url
else:
def url2pathname(pathname):
return pathname
return unquote(pathname)
def pathname2url(pathname):
return pathname
_url2pathname = url2pathname
def url2pathname(url):
return _url2pathname(unquote(url))
_pathname2url = pathname2url
def pathname2url(p):
return quote(_pathname2url(p))
return quote(pathname)
# This really consists of two pieces:
# (1) a class which handles opening of all sorts of URLs