Questions tagged [urllib3]

`urllib3` is a 3rd-party Python HTTP library with thread-safe connection pooling, file post, and more.

urllib3 is a library for python 2 and 3 providing a HTTP API with thread-safe connection pooling, file posting support, redirection handling and retries.

Documentation can be found at https://urllib3.readthedocs.io/en/latest/

760 questions
1005
votes
11 answers

What are the differences between the urllib, urllib2, urllib3 and requests module?

In Python, what are the differences between the urllib, urllib2, urllib3 and requests modules? Why are there three? They seem to do the same thing...
Paul Biggar
  • 27,579
  • 21
  • 99
  • 152
545
votes
15 answers

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

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, …
Patryk
  • 22,602
  • 44
  • 128
  • 244
512
votes
29 answers

Python Requests throwing SSLError

I'm working on a simple script that involves CAS, jspring security check, redirection, etc. I would like to use Kenneth Reitz's python requests because it's a great piece of work! However, CAS requires getting validated via SSL so I have to get…
TedBurrows
  • 5,401
  • 4
  • 16
  • 10
107
votes
20 answers

Python (pip) - RequestsDependencyWarning: urllib3 (1.9.1) or chardet (2.3.0) doesn't match a supported version

I found several pages about this issue but none of them solved my problem. Even if I do a : pip show I get : /usr/local/lib/python2.7/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.9.1) or chardet (2.3.0) doesn't match…
NuX_o
  • 1,173
  • 2
  • 7
  • 9
89
votes
17 answers

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

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…
BringBackCommodore64
  • 4,910
  • 3
  • 27
  • 30
73
votes
6 answers

What should I use to open a url instead of urlopen in urllib3

I wanted to write a piece of code like the following: from bs4 import BeautifulSoup import urllib2 url = 'http://www.thefamouspeople.com/singers.php' html = urllib2.urlopen(url) soup = BeautifulSoup(html) But I found that I have to install urllib3…
niloofar
  • 2,244
  • 5
  • 23
  • 44
69
votes
10 answers

ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with LibreSSL 2.8.3

After pip install openai, when I try to import openai, it shows this error: the 'ssl' module of urllib3 is compile with LibreSSL not OpenSSL I just followed a tutorial on a project about using API of OpenAI. But when I get to the first step which…
prismwatermelon
  • 793
  • 1
  • 5
  • 6
60
votes
2 answers

urllib3 connectionpool - Connection pool is full, discarding connection

Does seeing the urllib3.connectionpool WARNING - Connection pool is full, discarding connection mean that I am effectively loosing data (because of lost connection) OR Does it mean that connection is dropped (because pool is full); however, the…
JavaFan
  • 1,295
  • 3
  • 19
  • 28
53
votes
7 answers

Patch pyopenssl for sslv3 issue

I got a problem on a Debian 8 system with python 2.7.9-2 amd64: marius@pydev:/usr/lib/python2.7/dist-packages/urllib3/contrib$ pip search doo Traceback (most recent call last): File "/usr/bin/pip", line 9, in
wishi
  • 7,188
  • 17
  • 64
  • 103
49
votes
15 answers

Why requests raise this exception "check_hostname requires server_hostname"?

p={ 'http':'http://my correct proxy here', 'https':'https://my correct proxy here' } self.response=requests.get(url=url,headers=self.headers,timeout=(6,15),proxies=p) And then it raise the exception: Traceback (most recent call last): …
KEVIN
  • 821
  • 1
  • 4
  • 9
48
votes
1 answer

Python requests is slow and takes very long to complete HTTP or HTTPS request

When requesting a web resource or website or web service with the requests library, the request takes a long time to complete. The code looks similar to the following: import requests requests.get("https://www.example.com/") This request takes over…
vauhochzett
  • 2,732
  • 2
  • 17
  • 40
44
votes
3 answers

Why do I constantly see "Resetting dropped connection" when uploading data to my database?

I'm uploading hundreds of millions of items to my database via a REST API from a cloud server on Heroku to a database in AWS EC2. I'm using Python and I am constantly seeing the following INFO log message in the…
Andrew Thompson
  • 2,396
  • 1
  • 21
  • 23
39
votes
4 answers

How to retry urllib2.request when fails?

When urllib2.request reaches timeout, a urllib2.URLError exception is raised. What is the pythonic way to retry establishing a connection?
iTayb
  • 12,373
  • 24
  • 81
  • 135
38
votes
2 answers

How to make python .post() requests to retry?

I'm trying to implement requests retry in Python. It works like charm with .get() requests, but a .post() request never retries, regardless of a status code. I'd like to use it with .post() requests. My code: from requests.packages.urllib3.util…
user1554733
30
votes
4 answers

What's the meaning of pool_connections in requests.adapters.HTTPAdapter?

When initializing a requests' Session, two HTTPAdapter will be created and mount to http and https. This is how HTTPAdapter is defined: class requests.adapters.HTTPAdapter(pool_connections=10, pool_maxsize=10, …
laike9m
  • 18,344
  • 20
  • 107
  • 140
1
2 3
50 51