Message78754
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. |
|
Date |
User |
Action |
Args |
2009-01-02 04:13:49 | dmorr | set | recipients:
+ dmorr, skip.montanaro, facundobatista, jjlee, orsenthil, dcantrell-rh |
2009-01-02 04:13:49 | dmorr | set | messageid: <1230869629.1.0.9760193206.issue1675455@psf.upfronthosting.co.za> |
2009-01-02 04:13:47 | dmorr | link | issue1675455 messages |
2009-01-02 04:13:46 | dmorr | create | |
|