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 jerrykhan
Recipients
Date 2006-11-28.15:17:42
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Hello, 
In my sens in a general manner there is something wrong in the urllib2 http code:
But this may depends on the environment (I am not an expert in urllib)
Here are my tests : using python 2.4.2 on Windows XP
These simple codes failed with a 407 http error :
Example E1:
import urllib2 as URL
a=URL.urlopen("http://lan_apache_url")
print a.read()

OR example E2:
import urllib2 as URL
r=URL.Request("http://lan_apache_url")
a=URL.urlopen(r)
print a.read()

But succeed with urllib example E3
import urllib
a=urllib.urlopen("http://lan_apache_url")
print a.read()

Notice that different code lines are minimal E1 and E3 are close: 
Notice also that I'm try to access a lan apache server which is not behind a Proxy.
 And I don't want to access to any Proxy (like exclusion string in IExplorer)

But I found also that If I try to access to a protected link with HTTPS ... on the LAN, there is not problem. The issue is really on the HTTP interpreter or during the configuration of the URL opener. 

In the same time, some of my programs are able to access to Internet servers using the current Proxy server without any problem. For that, I use:
import urllib2 as URL
URL.install_opener(URL.build_opener( s.https_handler, s.proxy_auth_handler, s.cookie_handler))

Well, I developed a workaround in my programs ... to use urllib instead of urllib2 in the case where I try to access the LAN (in fact when I don't want to configure the Proxy server, or when the URL match my own proxy exclusion list.)

I espect this will help python urllib2 experts to find the issue.
Jérôme Vacher alias jerrykhan the foolish dracomorpheus of the emerald dragon dynasty.
History
Date User Action Args
2007-08-23 14:41:15adminlinkissue1519816 messages
2007-08-23 14:41:15admincreate