gpt4 book ai didi

python - urllib3 最大重试错误

转载 作者:太空狗 更新时间:2023-10-30 02:34:16 27 4
gpt4 key购买 nike

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

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/

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

最佳答案

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

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

更新: urllib3 v1.2现在在 PyPI 上,其中包括此修复程序和更多内容。 :)

关于python - urllib3 最大重试错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9021140/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com