mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Increase the coverage of macurl2path. Patch by Colin Williams.
This commit is contained in:
parent
a1782e1be8
commit
b82a3dc240
4 changed files with 34 additions and 21 deletions
|
@ -75,23 +75,3 @@ def pathname2url(pathname):
|
|||
def _pncomp2url(component):
|
||||
# We want to quote slashes
|
||||
return urllib.parse.quote(component[:31], safe='')
|
||||
|
||||
def test():
|
||||
for url in ["index.html",
|
||||
"bar/index.html",
|
||||
"/foo/bar/index.html",
|
||||
"/foo/bar/",
|
||||
"/"]:
|
||||
print('%r -> %r' % (url, url2pathname(url)))
|
||||
for path in ["drive:",
|
||||
"drive:dir:",
|
||||
"drive:dir:file",
|
||||
"drive:file",
|
||||
"file",
|
||||
":file",
|
||||
":dir:",
|
||||
":dir:file"]:
|
||||
print('%r -> %r' % (path, pathname2url(path)))
|
||||
|
||||
if __name__ == '__main__':
|
||||
test()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue