我刚刚(从源代码)全新安装了Python3.3,并安装了'requests‘库。我正在尝试一个非常简单的请求:
r = requests.get('https://www.google.com/')我得到了一个非常奇怪的错误:
File "/usr/local/lib/python3.3/http/cookiejar.py", line 1647, in extract_cookies
if self._policy.set_ok(cookie, request):
File "/usr/local/lib/python3.3/http/cookiejar.py", line 931, in set_ok
if not fn(cookie, request):
File "/usr/local/lib/python3.3/http/cookiejar.py", line 952, in set_ok_verifiability
if request.unverifiable and is_third_party(request):
AttributeError: 'MockRequest' object has no attribute 'unverifiable'由于我在某种程度上还是Python初学者,我完全不知道是什么导致了这个错误。有什么想法吗?
发布于 2012-09-30 16:50:24
这在python 3.2中有效:
Python 3.2.3 (default, Apr 13 2012, 13:31:19)
[GCC 4.2.1 Compatible Apple Clang 3.0 (tags/Apple/clang-211.12)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> r = requests.get('https://www.google.com/')requests FAQ声明了正式支持的Python3版本,您刚刚发现在Python3.3上,requests (还没有)工作。
问题跟踪器中有一个patch available,所以这只是时间问题。
更新:Version 0.14.1已于2012/10/01发布,并已修复:
0.14.1 (2012-10-01)
https://stackoverflow.com/questions/12659833
复制相似问题