urllib/urllib2 support for specifying ip address

Robin Becker robin at reportlab.com
Thu Jun 19 10:19:05 EDT 2014


On 19/06/2014 13:03, Chris Angelico wrote:
.........
>> I can use python >= 3.3 if required.
>
> The main reason I ask is in case something's changed. Basically, what
> I did was go to my Python 2 installation (which happens to be 2.7.3,
> because that's what Debian Wheezy ships with - not sure why it hasn't
> been updated beyond that), pull up urllib2.py, and step through
> manually, seeing where the hostname gets turned into an IP address.
> Hence, this code:
.........
in practice this approach worked well with urllib in python27.
-- 
Robin Becker




More information about the Python-list mailing list