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 csernazs
Recipients csernazs, dmorr, ned.deily, orsenthil
Date 2010-12-15.14:01:52
SpamBayes Score 0.00025531158
Marked as misclassified No
Message-id <1292421713.97.0.320098997563.issue5625@psf.upfronthosting.co.za>
In-reply-to
Content
The order of the IP addresses doesn't matter as urllib2 is flexible enough to handle all local IP addresses as local (that was the original bug - it handled only one IP returned by gethostbyname which returned a random IP if there were more than one).

So picking up the first IP is ok I think as the order of the IP addresses doesn't matter - urllib2 will handle all of them as local.
See urllib2.FileHandler.get_names().

The problem is that gethostbyname doesn't guarantee that it returns one IP address from the set returned by gethostbyname_ex as gethostbyname looks up the name in /etc/hosts file first (or as configured in NSS).
History
Date User Action Args
2010-12-15 14:01:54csernazssetrecipients: + csernazs, orsenthil, dmorr, ned.deily
2010-12-15 14:01:53csernazssetmessageid: <1292421713.97.0.320098997563.issue5625@psf.upfronthosting.co.za>
2010-12-15 14:01:52csernazslinkissue5625 messages
2010-12-15 14:01:52csernazscreate