简体   繁体   English

urllib3 maxretryError

[英]urllib3 maxretryError

I have just started using urllib3, and I am running into a problem straightaway. 我刚开始使用urllib3,我马上就遇到了问题。 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/')

I get thrown the following error: 我被抛出以下错误:

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. 非常感谢。

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! 对不起烦恼!

Update: urllib3 v1.2 is now on PyPI which includes this fix and more. 更新: urllib3 v1.2现在在PyPI上,其中包括此修复程序等。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM