Senthil Kumaran <orsent...@gmail.com> wrote:

> 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).

RFC 1738 explicitly says that "file://<host>/<path>" is pretty much useless
for anything except host=localhost:

``The file URL scheme is unusual in that it does not specify an Internet
protocol or access method for such files; as such, its utility in
network protocols between hosts is limited.''

So, FTP is *not* the "default protocol".  On the other hand, if <host>
actually begins with "ftp.", it's a pretty good guess that FTP will
work.  Similarly, if <host> actually begins with "www.", it's a pretty
good guess that HTTP will work.  This seems to me like a
practicality-vs.-purity consideration.

Bill
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to