File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1575,11 +1575,11 @@ def test_url2pathname_win(self):
1575
1575
self .assertEqual (fn ('///C|/path/to/file' ), 'C:\\ path\\ to\\ file' )
1576
1576
self .assertEqual (fn ("///C|/foo/bar/spam.foo" ), 'C:\\ foo\\ bar\\ spam.foo' )
1577
1577
# Non-ASCII drive letter
1578
- self .assertEqual (fn ("///\u00e8 |/" ), "\\ \ u00e8| \\ " )
1578
+ self .assertEqual (fn ("///\u00e8 |/" ), "u00e8: \\ " )
1579
1579
# UNC paths
1580
1580
self .assertEqual (fn ('//server/path/to/file' ), '\\ \\ server\\ path\\ to\\ file' )
1581
1581
self .assertEqual (fn ('////server/path/to/file' ), '\\ \\ server\\ path\\ to\\ file' )
1582
- self .assertEqual (fn ('/////server/path/to/file' ), '\\ \\ \\ server\\ path\\ to\\ file' )
1582
+ self .assertEqual (fn ('/////server/path/to/file' ), '\\ \\ server\\ path\\ to\\ file' )
1583
1583
# Localhost paths
1584
1584
self .assertEqual (fn ('//localhost/C:/path/to/file' ), 'C:\\ path\\ to\\ file' )
1585
1585
self .assertEqual (fn ('//localhost/C|/path/to/file' ), 'C:\\ path\\ to\\ file' )
Original file line number Diff line number Diff line change @@ -1654,7 +1654,7 @@ def url2pathname(url):
1654
1654
"""Convert the percent-encoded URL *url* to a local pathname."""
1655
1655
scheme , authority , path = urlsplit (url , scheme = 'file' )[:3 ]
1656
1656
if scheme != 'file' :
1657
- raise URLError (f'URI does not use " file" scheme: { url !r} ' )
1657
+ raise URLError (f'URL { url !r } uses non-` file` scheme { scheme !r} ' )
1658
1658
if os .name == 'nt' :
1659
1659
path = unquote (path )
1660
1660
if authority and authority != 'localhost' :
@@ -1673,7 +1673,7 @@ def url2pathname(url):
1673
1673
path = path .replace ('/' , '\\ ' )
1674
1674
else :
1675
1675
if not _is_local_host (authority ):
1676
- raise URLError (f'file URI not on local host: { url !r} ' )
1676
+ raise URLError (f'URL { url !r } uses non- local authority { authority !r} ' )
1677
1677
path = unquote (path )
1678
1678
return path
1679
1679
You can’t perform that action at this time.
0 commit comments