urllib.urlopen("file://...") fails

Jerome Alet alet at unice.fr
Fri Apr 26 03:45:57 EDT 2002


Seth Delackner wrote:
> 
> With python 2.2 on windows, with the file t:\tmp\package.html existing,
> 
> >>> import urllib
> >>> u = urllib.urlopen("file://t:/tmp/package.html")
> 
> Fails with the error below, but "file:t:/tmp/package.html" works. Is
> that even a valid url?

IMHO this is a bug in the urllib module when you want to open a local
file
and you specify the disk on which to find it under Windows.

if t: is your current working disk then don't put the t: in the path and 
it should work fine.

under *nix systems this problem doesn't exist (no disk letters)

hth.

Jerome Alet



More information about the Python-list mailing list