Derek Morr <derekm...@psu.edu> added the comment:

My understanding is that the FileHandler checks if the file:// URL 
contains the hostname or localhost IP of the local machine (isn't that 
what FileHandler.names is for?). So, shouldn't the following URLs all 
open the same file:

file:///foo.txt
file://localhost/foo.txt
file://127.0.0.1/foo.txt
file://[::1]/foo.txt

If that is the case, then doesn't FileHandler.names need to have all of 
those values in it?

I am a little confused by this though. It looks like 
FileHandler.file_open() checks if there is a hostname in the URL, and 
if so, uses FTPHandler instead. So why does FileHandler.open_local_file 
check the hostname value?

For your other points, gethostbyname() in libc can only handle IPv4 
addresses. The IETF defined the getaddrinfo() interface as an IP 
version neutral replacement. I would recommend using getaddrinfo().

Yes, FTPHandler creates an urllib.FTPWrapper object. That object calls 
into ftplib, which is already IPv6-capable. So, I don't think we need 
to do hostname resolution in FTPHandler.

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

Reply via email to