[Python-Dev] Can ftp url start with file:// ?

Senthil Kumaran orsenthil at gmail.com
Fri Jul 9 06:38:04 CEST 2010


On Fri, Jul 09, 2010 at 02:23:40PM +1000, Steven D'Aprano wrote:
> > Is this is valid ftp url?
> >
> > # file://ftp.example.com/blah.txt (an ftp URL)
> >
> > My answer is no. When we have the scheme specifically mentioned as
> > file:// it is no point in considering it as ftp url (which should
> > start with ftp://).
> 
> I agree. Just because the host is *called* ftp doesn't mean you should 
> use the ftp protocol to get the file.

It was not just for the host being called ftp.example.com

It was for a pattern that file:/// is local file (correct) and
file://localhost/somepath is again local file (correct again) but
file://anyhost.domain/file.txt is actually ftp (pretty weird).

> Do you have a url for the bug report?

http://bugs.python.org/issue8801

Don't go into the suggestion in the report, but just notice that file
url lead to an ftp error exception.

-- 
Senthil


More information about the Python-Dev mailing list