Bug in urllib?
cito at online.de
Sun Oct 15 05:00:44 CEST 2006
> gives IOError : Bad Url, only coz of the :1030 which should be
> accurate portnumber. Is it something I did wrong, or a bug. And what
> to do to avoid this (except rewriting url2pathname)?
OS-specific conversion from a relative URL of the 'file' scheme
to a file system path; not recommended for general use.
So first, you must use a URL of the 'file' scheme, not of the 'http'
scheme. This is something like:
'file://localhost/C|/srv/cgi.bin/js.cgi' or 'file:///C|/srv/cgi.bin/js.cgi
Second, it must be a "relative URL" which is a bit mistakable here. What
is actually meant is that you must not prepend it with 'file:'.
So you have to pass
On Windows, this will give you:
The docs at http://docs.python.org/lib/module-urllib.html say basically
the same, you need to pass the *path component* of an URL, not the
More information about the Python-list