File tree 2 files changed +9
-8
lines changed
Filter options
2 files changed +9
-8
lines changed
Original file line number Diff line number Diff line change @@ -1575,7 +1575,7 @@ 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' )
Original file line number Diff line number Diff line change @@ -823,14 +823,15 @@ def test_file(self):
823
823
urls = [
824
824
"file://localhost%s" % urlpath ,
825
825
"file://%s" % urlpath ,
826
- "file://%s%s" % (socket .gethostbyname ('localhost' ), urlpath ),
827
826
]
828
- try :
829
- localaddr = socket .gethostbyname (socket .gethostname ())
830
- except socket .gaierror :
831
- localaddr = ''
832
- if localaddr :
833
- urls .append ("file://%s%s" % (localaddr , urlpath ))
827
+ if os .name == 'nt' :
828
+ urls .append ("file://%s%s" % (socket .gethostbyname ('localhost' ), urlpath ))
829
+ try :
830
+ localaddr = socket .gethostbyname (socket .gethostname ())
831
+ except socket .gaierror :
832
+ localaddr = ''
833
+ if localaddr :
834
+ urls .append ("file://%s%s" % (localaddr , urlpath ))
834
835
835
836
for url in urls :
836
837
f = open (TESTFN , "wb" )
You can’t perform that action at this time.
0 commit comments