Message30472
The documentation for urllib2.urlopen() says that it
"[r]aises URLError on errors". But if urllib2 requests
a resource from a (misconfigured) Web server and that
server returns 302 response with the Location header
set to "file:", urlopen raises "OSError: [Errno 2] No
such file or directory: ''". I have seen such a
misconfiguration in the wild; I've also created a URL
on my server that reproduces the problem in case the
real-world URL disappears or is fixed. Both URLs are in
the attachment with code to reproduce the problem.
I can recreate this under Python 2.3 - 2.5 under Mac OS
X, FreeBSD and Win2k.
I would be satisfied if the module simply followed the
documentation and actually returned URLError.
|
|
| Date |
User |
Action |
Args |
| 2007-08-23 14:49:32 | admin | link | issue1591774 messages |
| 2007-08-23 14:49:32 | admin | create | |
|