Senthil Kumaran added the comment:

Thanks for the report. Point 2 is definitely a bug (and an overlook by me), I 
will fix it.

I think, the url[:2] == '//' check was present for ftp case which supported 
file:// protocol. I can't see a clear requirement to change here.

The scenarios you encounter when giving a two different paths are interesting 
because, in one the path stat('/invalid/path') and in the other it is the path 
'/' that is stat and only late is the hostname verified if it coming from 
localhost 
(http://hg.python.org/cpython/file/ddfcaeb1c56b/Lib/urllib/request.py#l1353). 
Since both presence of file locally and then ensuring the host is localhost 
needs to be done, the current order gives faster failures for most common 
use-cases.

----------
nosy: +orsenthil

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21970>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to