URLError:

发布于 2024-10-03 07:37:36 字数 1034 浏览 1 评论 0原文

每当我调用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

月下凄凉 2024-10-10 07:37:37

这个错误通常是由管理不善或设置不当的防火墙或代理系统造成的,如果您尝试从家庭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.

薯片软お妹 2024-10-10 07:37:37

尝试使用 cache=None 作为客户端参数。它帮助我解决了同样的问题。

client = suds.client.Client(url, cache=None)

Try cache=None as client param. It helped me to solve same issue.

client = suds.client.Client(url, cache=None)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文