urllib3 最大重试错误 [英] urllib3 maxretryError

查看:53
本文介绍了urllib3 最大重试错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用 urllib3,我马上就遇到了一个问题.根据他们的手册,我从一个简单的例子开始:

I have just started using urllib3, and I am running into a problem straightaway. According to their manuals, I started off with the simple example:

Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib3
>>> 
>>> http = urllib3.PoolManager()
>>> r = http.request('GET', 'http://google.com/')

我收到以下错误:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/urllib3/request.py", line 65, in request
**urlopen_kw)
File "/usr/local/lib/python2.7/dist-packages/urllib3/request.py", line 78, in request_encode_url
return self.urlopen(method, url, **urlopen_kw)
File "/usr/local/lib/python2.7/dist-packages/urllib3/poolmanager.py", line 113, in urlopen
return self.urlopen(method, e.new_url, **kw)
File "/usr/local/lib/python2.7/dist-packages/urllib3/poolmanager.py", line 113, in urlopen
return self.urlopen(method, e.new_url, **kw)
File "/usr/local/lib/python2.7/dist-packages/urllib3/poolmanager.py", line 113, in urlopen
return self.urlopen(method, e.new_url, **kw)
File "/usr/local/lib/python2.7/dist-packages/urllib3/poolmanager.py", line 113, in urlopen
return self.urlopen(method, e.new_url, **kw)
File "/usr/local/lib/python2.7/dist-packages/urllib3/poolmanager.py", line 109, in urlopen
return conn.urlopen(method, url, **kw)
File "/usr/local/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 309, in urlopen
raise MaxRetryError(url)
urllib3.exceptions.MaxRetryError: Max retries exceeded for url: http://google.com/

关于为什么会发生这种情况的任何线索?非常感谢.

Any clues as to why this happens? Many thanks.

推荐答案

这是一个已知错误,已在 master 分支中修复:

This is a known bug which has been fixed in the master branch:

我真的应该在上周末发布带有此修复程序的错误修复版本,但我没时间了.即将到来的周末的下一个版本应该包括这个修复(以及其他一些很酷的改进).给您添麻烦了!

I really should have published a bugfix release last weekend with this fix, but I ran out of time. The next release this coming weekend should include this fix (and a bunch of other cool improvements). Sorry for the troubles!

更新: urllib3 v1.2 现已上线PyPI 其中包括此修复程序等.:)

Update: urllib3 v1.2 is now on PyPI which includes this fix and more. :)

这篇关于urllib3 最大重试错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆