urllib3

Obnoxious CryptographyDeprecationWarning because of missing hmac.compare_time function everywhere

瘦欲@ 提交于 2019-12-19 07:20:27
问题 Things were running along fine until one of my projects started printing this everywhere, at the top of every execution, at least once: local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible. I have no idea why it started and it's disrupting the

TypeError: urlopen() got multiple values for keyword argument 'body' while executing tests through Selenium and Python on Kubuntu 14.04

≯℡__Kan透↙ 提交于 2019-12-18 08:01:02
问题 im trying to run a selenium in python on Kubuntu 14.04. I get this error message trying with chromedriver or geckodriver, both same error. Traceback (most recent call last): File "vse.py", line 15, in <module> driver = webdriver.Chrome(chrome_options=options, executable_path=r'/root/Desktop/chromedriver') File "/usr/local/lib/python3.4/dist-packages/selenium/webdriver/chrome/webdriver.py", line 75, in __init__ desired_capabilities=desired_capabilities) File "/usr/local/lib/python3.4/dist

Dealing with Bad request

*爱你&永不变心* 提交于 2019-12-18 07:17:24
问题 I’m getting: 'HTTP/1.1 400 Bad Request\r\n' and I don’t get why. It looks like it authenticates and then there is a redirection and then it now doesn’t work. Why is this happening? I had thought it was the header and that it was missing content type, but even adding that produced the same outcome.. headers = { 'basic_auth': 'brofewfefwefewef:EKAXsWkdt5H6yJEmtexN', 'Content-Type': 'application/json' } client = Client(ClientConfig(), headers=headers, refresh=True) class FileDownloader(object):

Python's requests “Missing dependencies for SOCKS support” when using SOCKS5 from Terminal

五迷三道 提交于 2019-12-17 21:53:11
问题 I'm trying to interact with an API from my Python 2.7 shell using a package that relies on Python's requests. Thing is the remote address is blocked by my network (university library). So to speak to the API I do the following: ~$ ssh -D 8080 name@myserver.com And then, in new terminal, in local computer: ~$ export http_proxy=socks5://127.0.0.1:8080 https_proxy=socks5://127.0.0.1:8080 Then I run the program in Python console but fails: ~$ python >>> import myscript >>> id = '1213' >>> token =

Suppress InsecureRequestWarning: Unverified HTTPS request is being made in Python2.6

妖精的绣舞 提交于 2019-12-17 05:17:50
问题 I am writing scripts in Python2.6 with use of pyVmomi and while using one of the connection methods: service_instance = connect.SmartConnect(host=args.ip, user=args.user, pwd=args.password) I get the following warning: /usr/lib/python2.6/site-packages/requests/packages/urllib3/connectionpool.py:734: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html

Suppress InsecureRequestWarning: Unverified HTTPS request is being made in Python2.6

我只是一个虾纸丫 提交于 2019-12-17 05:17:01
问题 I am writing scripts in Python2.6 with use of pyVmomi and while using one of the connection methods: service_instance = connect.SmartConnect(host=args.ip, user=args.user, pwd=args.password) I get the following warning: /usr/lib/python2.6/site-packages/requests/packages/urllib3/connectionpool.py:734: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html

Tweepy OpenSSL.SSL.WantReadError

故事扮演 提交于 2019-12-12 16:35:07
问题 Python 3.6. I use the streamer of tweepy to get tweets. It works well. But sometimes, if I let it open for more than 24h, I have this error Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\requests\packages\urllib3\contrib\pyopenssl.py", line 277, in recv_into return self.connection.recv_into(*args, **kwargs) File "C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1547, in recv_into self._raise_ssl_error(self._ssl, result) File "C:\ProgramData

import urllib3 works in terminal but not on IDLE

守給你的承諾、 提交于 2019-12-12 04:29:50
问题 I am using Mac OSX 10.10.5, and Python version 3.5.2, and IDLE version 3.5.2. I am extremely new to Python, and am trying to use the urllib3 module in IDLE. I have used the following code in the Terminal with success (the number 200 is returned): import urllib3 http = urllib3.PoolManager() r = http.request('GET', 'http://httpbin.org/robots.txt') r.status But the same code does not work in IDLE. In IDLE I get the following error: Traceback (most recent call last): File "/Users/faculty

How to authenticate with requests module using a trust store?

狂风中的少年 提交于 2019-12-12 03:30:24
问题 I am currently writing a python language plugin for a compiler I have written that automates http calls for a RESTful API. I have managed to get the login/authentication working using the socket and ssl modules, but this low-level approach seems to create potential problems with parsing the response in order to obtain the authentication token and secret. The requests module seems popular/efficient, however, I cannot seem to get it to function properly for my particular authentication needs. I

How to completly reset requests?

爱⌒轻易说出口 提交于 2019-12-11 14:07:51
问题 I'm using requests to make many http requests, and some time, i get timeouts. When i restart the python program, it goes fine. I tried to replicate the "restart the program" with exception handling, but it doesn't works. When i run that : import requests session=requests.session() while 1: try: session.get('..url..') except requests.Timeout: session=requests.session() it doesn't do the same thing as restarting the program : i get stucked whith timeout, whereas when i restart the program, i