Unique URLError: error on urlopen error> Error I get

I run my application on my production server and it gives me this error:

File "/usr/lib/python2.6/urllib2.py", line 391, in open
   response = self._open(req, data)

 File "/usr/lib/python2.6/urllib2.py", line 409, in _open
   '_open', req)

 File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
   result = func(*args)

 File "/usr/lib/python2.6/urllib2.py", line 1161, in http_open
   return self.do_open(httplib.HTTPConnection, req)

 File "/usr/lib/python2.6/urllib2.py", line 1136, in do_open
   raise URLError(err)

URLError: <urlopen error timed out>

By the way, I get it error. But it is not interesting. The interesting part is that when I run this on my own local machine or test server, everything works fine. This is too annoying.

Everyone where I use the same OS:

ubuntu 10.04

What could be the reason? Any help would be appreciated.

+5
source share
2 answers

Can you get the url from wgeton your production server? This might be a firewall issue, not a Python bug.

+1
source

, , , , - , , , -, t, - .

, , socket.setdefaulttimeout/socket.settimeout. urllib2.urlopen - python2.6. urllib2.urlopen(..., timeout = None) , -.

socket.getdefaulttimeout , urlopen.

0

All Articles