By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,050 Members | 1,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,050 IT Pros & Developers. It's quick & easy.

socket.error connection refused

P: n/a
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?

Nov 23 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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()
'<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">\n<TITLE>302 Moved</TITLE></HEAD><BODY>\n<H1>302 Moved</H1>\nThe document has moved\n<A HREF="http://www.google.de/">here</A>.\r\n</BODY></HTML>\r\n'
>>>
fails on multiple trials, then you have a very strange network setup. maybe multiple/confusing NIC's ...
Robert
Nov 24 '06 #2

P: n/a

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()
'<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">\n<TITLE>302 Moved</TITLE></HEAD><BODY>\n<H1>302 Moved</H1>\nThe document has moved\n<A HREF="http://www.google.de/">here</A>.\r\n</BODY></HTML>\r\n'
>>

fails on multiple trials, then you have a very strange network setup. maybe multiple/confusing NIC's ...
Robert
Nov 24 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.