This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dmorr
Recipients dcantrell-rh, dmorr, facundobatista, jjlee, orsenthil, skip.montanaro
Date 2009-01-02.04:13:46
SpamBayes Score 1.3657852e-06
Marked as misclassified No
Message-id <1230869629.1.0.9760193206.issue1675455@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-01-02 04:13:49dmorrsetrecipients: + dmorr, skip.montanaro, facundobatista, jjlee, orsenthil, dcantrell-rh
2009-01-02 04:13:49dmorrsetmessageid: <1230869629.1.0.9760193206.issue1675455@psf.upfronthosting.co.za>
2009-01-02 04:13:47dmorrlinkissue1675455 messages
2009-01-02 04:13:46dmorrcreate