URLError:
每当我调用 facebook 服务器以使用 FQL 获取用户数据时,有 10% 的情况
URLError: <urlopen error [Errno 104] Connection reset by peer>
我无法重现此错误。以下是回溯:
File "/home/fb.py", line 250, in get_data()
return json.load(urlopen(URL, params))
File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
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 1169, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.6/urllib2.py", line 1136, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 104] Connection reset by peer>
任何帮助表示赞赏
Whenever I make a call to facebook server to fetch user data using FQL, 10% of the time I get
URLError: <urlopen error [Errno 104] Connection reset by peer>
I am not able to reproduce this error. Below is the traceback:
File "/home/fb.py", line 250, in get_data()
return json.load(urlopen(URL, params))
File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
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 1169, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.6/urllib2.py", line 1136, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 104] Connection reset by peer>
Any help appreciated
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个错误通常是由管理不善或设置不当的防火墙或代理系统造成的,如果您尝试从家庭adsl线路或简单的连接上运行您的程序,您的代码应该没有问题,104是当内部有东西时抛出的错误代码你的局域网发出嘶嘶声,停止哭泣。
This error is usually created by mismanaged or badly setup firewalls or proxy systems, if you try running your program from a household adsl line or on a simple connection there should be no problem with your code, 104 is the error code thrown back when something inside your local area network has a hissy fit and gives up crying.
尝试使用
cache=None
作为客户端参数。它帮助我解决了同样的问题。Try
cache=None
as client param. It helped me to solve same issue.