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
8
votes
1 answer

Python ImportError: sys.meta_path is None, Python is likely shutting down

When using __del__ datetime.date.today() throws ImportError: sys.meta_path is None, Python is likely shutting down import datetime import time import sys class Bug(object): def __init__(self): print_meta_path() def…
8
votes
2 answers

Does urllib3 support HTTP/2 Requests? Will it?

I know the following about various python HTTP libraries: Requests does not support HTTP/2 requests. Hyper does support HTTP/2 requests, but is archived as of early 2021 and wouldn't be a good choice for new projects. HTTPX does support HTTP/2, but…
kashev
  • 382
  • 2
  • 15
8
votes
0 answers

Python requests [Errno 111] Connection refused when running on server, but not on local PC

I have a web scraper script which runs fine on my (Windows) PC, but I'm trying to get it to run from a (Linux) web server. I have a number of other scripts which run fine on the server (connecting to different websites than this one), but when I run…
Thomas M
  • 131
  • 1
  • 1
  • 7
8
votes
2 answers

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

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 driver =…
Geeh Oliveira
  • 103
  • 2
  • 8
8
votes
2 answers

Reenable urllib3 warnings

I have a portion of my code where I knowingly make an Insecure Request. So I disable warnings with urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) After that part, how do I reenable/reset urllib3 warnings in my script?
RAbraham
  • 5,956
  • 8
  • 45
  • 80
8
votes
1 answer

InsecurePlatformWarning when building Docker image

I get this warning when building my Docker image: /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from…
Joe Mornin
  • 8,766
  • 18
  • 57
  • 82
8
votes
1 answer

How to print raw html string using urllib3?

I use below statment to get html string: import urllib3 url ='http://urllib3.readthedocs.org/' http_pool = urllib3.connection_from_url(url) r = http_pool.urlopen('GET',url) print (r.data) But the output is : b'
Mithril
  • 12,947
  • 18
  • 102
  • 153
7
votes
1 answer

How to Use SSLContext with Python Requests Library?

The certifi library often runs into issues with domain certificates, but in the standard urllib.request library has no issue. If I set the context to use the certifi's file, I get the SSL error, import ssl import certifi import requests.urllib as…
JabberJabber
  • 341
  • 2
  • 17
7
votes
2 answers

pip install urllib3 hanging on "Caching due to etag"

Pip install of urllib3 is hanging on "Caching due to etag". I'm building an AWS chalice project that doesn't let you specify --no-cache-dir, so I need to fix the issue without that command. Any ideas? Using Python 3.6.5 and Pip 10.0.1 in a virtual…
mbrz_0101
  • 85
  • 7
7
votes
3 answers

Cloud Vision API Client threw an OS Error "too many open files"

I have met an Error of "Too many open files" when I run label detection via Cloud Vision API Client with Python. When I asked this probrem on GitHub before this post, the maintainer gave me an advice that the problem is general Python issue rather…
katsuya
  • 71
  • 2
7
votes
1 answer

Can't Import Requests into Python: ImportError no module named urllib3

I've searched on this but other examples I've come across are people having issues installing Requests, my issue is around importing the module: Using Putty (connected to a HDF 2.4 sandbox session) and Python to call an API. Last night, I had this…
Jon295087
  • 731
  • 1
  • 8
  • 28
7
votes
3 answers

Python requests ImportError: cannot import name HeaderParsingError

OS: Mac OS X. When I'm trying to run the code below, I get the error: ImportError: cannot import name HeaderParsingError I've attached traceback below the code. I've tried to solve this issue for 20 min now, using Google and other stackoverflow.…
seb
  • 2,251
  • 9
  • 30
  • 44
7
votes
1 answer

Error when trying to use urllib3 & json to get Rotten Tomatoes data (Python)

As an introduction to APIs, I'm trying to figure out how to access data in python using the Rotten Tomatoes API. This is also my first time dealing with json. I'm using Python 3.4 and have confirmed that json and urllib3 have been installed. Here is…
user3175088
7
votes
4 answers

Passing web data into Beautiful Soup - Empty list

I've rechecked my code and looked at comparable operations on opening a URL to pass web data into Beautiful Soup, for some reason my code just doesn't return anything although it's in correct form: >>> from bs4 import BeautifulSoup >>> from urllib3…
user3885774
  • 75
  • 1
  • 1
  • 5