mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Fix Issue11474 - fix url2pathname() handling of '/C|/' on Windows
This commit is contained in:
parent
95cd91c17f
commit
2d2ea1b431
3 changed files with 25 additions and 1 deletions
|
@ -27,9 +27,12 @@ def url2pathname(url):
|
|||
drive = comp[0][-1].upper()
|
||||
components = comp[1].split('/')
|
||||
path = drive + ':'
|
||||
for comp in components:
|
||||
for comp in components:
|
||||
if comp:
|
||||
path = path + '\\' + urllib.parse.unquote(comp)
|
||||
# Issue #11474 - handing url such as |c/|
|
||||
if path.endswith(':') and url.endswith('/'):
|
||||
path += '\\'
|
||||
return path
|
||||
|
||||
def pathname2url(p):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue