Errore del cookie http Python 3.3
-
11-12-2019 - |
Domanda
Ho appena fatto una nuova installazione (dalla fonte) di Python 3.3 e ho installato la libreria 'Richieste'.Sto tentando una richiesta molto semplice:
r = requests.get('https://www.google.com/')
.
E sto ottenendo un errore molto strano in cambio:
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'
.
Vedere come sono ancora un po 'un principiante Python, non ho assolutamente idea di cosa stia causando questo errore.Qualche idea?
Soluzione
Funziona in 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/')
.
the requests
FAQ Stati Python 3 è supportato aVersione 3.2, e hai appena scoperto con Python 3.3, requests
non (ancora) funziona.
C'è un Patch disponibile nel problema Tracker, quindi è solo una questionedel tempo.
Aggiornamento : Versione 0.14.1 è stato rilasciato il 2012/10/01, con la correzione:
.0.14.1 (2012-10-01)
.
- Python 3.3 Compatibilità
- Semplicemente Default Accept-Encoding
- bugfixes
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow