Julia Dolgova added the comment:

May be I described the problem not clearly enough, because English is not my 
native language, so I try to explain once again.

In Windows there is an option "Do not use proxy server for address beginning 
with". I call this option <proxy bypass list>. This option is invented for 
Internet Explorer (IE) and is used by IE. It could be used by other 
applications and I think it's obvious that other applications must handle it 
same way as IE does. May be I'm wrong here, please dissuade me.

The problem is that IE only compares the hostname received with items in this 
list. And urllib also makes the reverse lookup and the forward lookup of the 
hostname and compares the results of those lookups with items in this list. To 
reproduce that you need to:
1. Run a proxy on your Windows or use any other proxy, that outputs requests 
coming from clients.
2. On Windows in "Browser settings" (IE settings) turn on the option "use 
proxy", set up the IP of your proxy, set the list "Do not use proxy server for 
address beginning with" to '' (without commas). ( - 
is the result of 'nslookup python.org' at this time when I write this comment)
3. Make a request in IE to http://python.org/. Then analyze the output of your 
proxy. You will see that the request to python.org goes through proxy. 
4. Make a request to http://python.org/ via urllib (run checklib-py3.py). 
Analyze the output of your proxy. You will see that the request to python.org 
bypasses proxy.

Be careful: there might be redirections when you make a request to 
http://python.org/. If you see 'http://www.python.org/' in proxy output and 
don't see 'http://python.org/' it means that request to 'python.org' bypasses 

This is the behavioral part of the problem which is attended by the performance 
decreasing, because the reverse lookup on some dns servers for some hostnames 
works slowly (up to 10 secs sometimes). May be the solution in my PR is not 
smart enough. But how can I make this issue go forward?

Added file: http://bugs.python.org/file46766/checklib-py3.py

Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list

Reply via email to