mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
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:
parent
f61bbc8182
commit
367ac80d3b
2 changed files with 17 additions and 23 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue