socket.error connection refused
Hi, I'm not sure this is the proper forum but I try nevertheless. The problem I'am facing is that the socket library always fail to connect to an URL. The net effect is that I can not use setuptools. I'm using Python2.4 on a windows XPPRO Sp2 machine. The firewall is disabled. There is no NLTM proxy. I connect to the internet through a NAT server (and it works). Other than with easy_install I tried to connect to a number of external urls (all of them running) and even to localhost, directly in script using urllib and the error is always the same errno: 10061 connection refused. Any ideas? -- http://mail.python.org/mailman/listinfo/python-list
Re: socket.error connection refused
Hi, the reason I mentioned the socket is because that is where the error eventually occurs. the code I tried manually (with different urls including a local one) is the following: import urllib fo=urllib.urlopen("http://www.google.com";) the error I get is: File "", line 1, in ? File "C:\Python24\lib\urllib.py", line 82, in urlopen return opener.open(url) File "C:\Python24\lib\urllib.py", line 190, in open return getattr(self, name)(url) File "C:\Python24\lib\urllib.py", line 313, in open_http h.endheaders() File "C:\Python24\lib\httplib.py", line 798, in endheaders self._send_output() File "C:\Python24\lib\httplib.py", line 679, in _send_outp self.send(msg) File "C:\Python24\lib\httplib.py", line 646, in send self.connect() File "C:\Python24\lib\httplib.py", line 630, in connect raise socket.error, msg IOError: [Errno socket error] (10061, 'Connection refused') Tim Williams ha scritto: > On 23 Nov 2006 04:09:18 -0800, Vania <[EMAIL PROTECTED]> wrote: > > Hi, I'm not sure this is the proper forum but I try nevertheless. > > The problem I'am facing is that the socket library always fail to > > connect to an URL. The net effect is that I can not use setuptools. > > I'm using Python2.4 on a windows XPPRO Sp2 machine. > > The firewall is disabled. > > There is no NLTM proxy. > > I connect to the internet through a NAT server (and it works). > > Other than with easy_install I tried to connect to a number of external > > urls > > (all of them running) and even to localhost, > > directly in script using urllib > > and the error is always the same errno: 10061 connection refused. > > Any ideas? > > A socket can't connect to a URL, a URL is an absolute location of an > internet resource, eg hostname + (virtual) location on a server + page > name. A socket can connect to an IP address or hostname - which is > the first part of the URL after the "http://"; (or ftp:// etc) > > You need to post a code snippet and the errors you are getting. -- http://mail.python.org/mailman/listinfo/python-list
Re: socket.error connection refused
Hi, the telnet call succeed Vania Bjoern Schliessmann ha scritto: > Vania wrote: > > > IOError: [Errno socket error] (10061, 'Connection refused') > > What does "telnet www.google.com 80" in some cmd.exe window say? The > same? > > Regards, > > > Björn > > -- > BOFH excuse #36: > > dynamic software linking table corrupted -- http://mail.python.org/mailman/listinfo/python-list
Re: socket.error connection refused
For anyone interested restarting windows fixed the connection problem. -- http://mail.python.org/mailman/listinfo/python-list
Re: socket.error connection refused
Thanks for the explanation. Probably the fact that I was working inside a virtual machine didn't help. Vania robert ha scritto: > Vania wrote: > > Hi, I'm not sure this is the proper forum but I try nevertheless. > > The problem I'am facing is that the socket library always fail to > > connect to an URL. The net effect is that I can not use setuptools. > > I'm using Python2.4 on a windows XPPRO Sp2 machine. > > The firewall is disabled. > > There is no NLTM proxy. > > I connect to the internet through a NAT server (and it works). > > Other than with easy_install I tried to connect to a number of external > > urls > > (all of them running) and even to localhost, > > directly in script using urllib > > and the error is always the same errno: 10061 connection refused. > > Any ideas? > > > urllib.urlopen can pick up an invalid proxy setting from environ or > IE-settings. > > routers/NAT servers sometimes need a 2nd tick - all browsers try it 2..4 > times before displaying "no connection" - this is (unfortunately) not the > default behavior of the "browser" urllib. > > if bare > > >>> import httplib > >>> h=httplib.HTTPConnection('www.google.com') > >>> h.connect() > >>> h.request('GET','/') > >>> h.getresponse().read() > ' content="text/html;charset=utf-8">\n302 > Moved\n302 Moved\nThe document has moved\n HREF="http://www.google.de/";>here.\r\n\r\n' > >>> > > fails on multiple trials, then you have a very strange network setup. maybe > multiple/confusing NIC's ... > > > Robert -- http://mail.python.org/mailman/listinfo/python-list