@@ -1484,6 +1484,7 @@ def test_pathname2url_nonascii(self):
14841484 'test specific to Windows pathnames.' )
14851485 def test_url2pathname_win (self ):
14861486 fn = urllib .request .url2pathname
1487+ self .assertEqual (fn ('/' ), '\\ ' )
14871488 self .assertEqual (fn ('/C:/' ), 'C:\\ ' )
14881489 self .assertEqual (fn ("///C|" ), 'C:' )
14891490 self .assertEqual (fn ("///C:" ), 'C:' )
@@ -1502,8 +1503,10 @@ def test_url2pathname_win(self):
15021503 self .assertEqual (fn ('/C|/path/to/file' ), 'C:\\ path\\ to\\ file' )
15031504 self .assertEqual (fn ('///C|/path/to/file' ), 'C:\\ path\\ to\\ file' )
15041505 self .assertEqual (fn ("///C|/foo/bar/spam.foo" ), 'C:\\ foo\\ bar\\ spam.foo' )
1505- # Non-ASCII drive letter
1506- self .assertRaises (IOError , fn , "///\u00e8 |/" )
1506+ # Colons in URI
1507+ self .assertEqual (fn ('///\u00e8 |/' ), '\u00e8 :\\ ' )
1508+ self .assertEqual (fn ('//host/share/spam.txt:eggs' ), '\\ \\ host\\ share\\ spam.txt:eggs' )
1509+ self .assertEqual (fn ('///c:/spam.txt:eggs' ), 'c:\\ spam.txt:eggs' )
15071510 # UNC paths
15081511 self .assertEqual (fn ('//server/path/to/file' ), '\\ \\ server\\ path\\ to\\ file' )
15091512 self .assertEqual (fn ('////server/path/to/file' ), '\\ \\ server\\ path\\ to\\ file' )
0 commit comments