test_urliib2 takes > 30 seconds, then fails: C:\Code\python\dist\src\PCbuild>python ../lib/test/test_urllib2.py Traceback (most recent call last): File "../lib/test/test_urllib2.py", line 15, in ? f = urllib2.urlopen(file_url) File "c:\code\python\dist\src\lib\urllib2.py", line 135, in urlopen return _opener.open(url, data) File "c:\code\python\dist\src\lib\urllib2.py", line 319, in open '_open', req) File "c:\code\python\dist\src\lib\urllib2.py", line 298, in _call_chain result = func(*args) File "c:\code\python\dist\src\lib\urllib2.py", line 904, in file_open return self.open_local_file(req) File "c:\code\python\dist\src\lib\urllib2.py", line 923, in open_local_file if not host or \ socket.error: host not found The URL it's passing is file://c:\code\python\dist\src\lib\urllib2.pyc If I change test_urllib2's file_url = "file://%s" % urllib2.__file__ to (adding another slash) file_url = "file:///%s" % urllib2.__file__ then it fails like this instead, but very quickly: C:\Code\python\dist\src\PCbuild>python ../lib/test/test_urllib2.py Traceback (most recent call last): File "../lib/test/test_urllib2.py", line 15, in ? f = urllib2.urlopen(file_url) File "c:\code\python\dist\src\lib\urllib2.py", line 135, in urlopen return _opener.open(url, data) File "c:\code\python\dist\src\lib\urllib2.py", line 319, in open '_open', req) File "c:\code\python\dist\src\lib\urllib2.py", line 298, in _call_chain result = func(*args) File "c:\code\python\dist\src\lib\urllib2.py", line 904, in file_open return self.open_local_file(req) File "c:\code\python\dist\src\lib\urllib2.py", line 925, in open_local_file return addinfourl(open(url2pathname(file), 'rb'), IOError: [Errno 2] No such file or directory: '\\c:\\code\\python\\dist\\src\\lib\\urllib2.pyc' Here's what I know about URLs: . Here's what I know about file URLs: . Here's what I know about file URLs on Windows: . If I type the original file://c:\code\python\dist\src\lib\urllib2.pyc into IE's address bar, it actually *executes* urllib2.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4