urllib2 in Python 2.6.4: Any way to override windows hosts file?

Posted by mikez302 on Stack Overflow See other posts from Stack Overflow or by mikez302
Published on 2010-04-02T20:55:38Z Indexed on 2010/04/02 21:03 UTC
Read the original article Hit count: 422

Filed under:
|
|
|
|

I am using the urllib2 module in Python 2.6.4, running in Windows XP, to access a URL. I am making a post request, that does not involve cookies or https or anything too complicated. The domain is redirected in my C:\WINDOWS\system32\drivers\etc\hosts file. However, I would like the request from urllib2 to go to the "real" domain and ignore the entry in the hosts file. Is there any easy and practical way to do this?

© Stack Overflow or respective owner

Related posts about python

Related posts about urllib2