-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dependency incompatibility: requests (latest:2.30.0), urllib3>=2.0.0 #11419
Comments
From what I read on the linked issue, .29 did not support urllib3 version 2, but .30 now does, as the upper-bound was raised to <3. Is your understanding different? A |
Thanks - you read correctly, and I missed that detail. In practice I find that I had misattributed that to the compatibility mismatch - but in fact it could be a regression in |
I've got a near-minimal repro case, but I'm beginning to wonder whether this change could in fact mean that there's a bug / unusual behaviour in the |
Repro case: from contextlib import contextmanager
from http.server import BaseHTTPRequestHandler, HTTPServer
from threading import Thread
import requests
class TestHandler(BaseHTTPRequestHandler):
protocol_version = "HTTP/1.1"
def do_GET(self):
if self.path == "/":
self.send_response(200, "OK")
self.send_header("Content-Length", 0)
self.end_headers()
else:
self.send_response(404, "Not Found")
self.send_header("Content-Length", "0")
self.end_headers()
class TestServer(Thread):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.server = HTTPServer(("localhost", 8080), TestHandler)
def run(self):
self.server.serve_forever()
def join(self):
self.server.shutdown()
self.server.server_close()
super().join()
@contextmanager
def server_context():
server_thread = TestServer()
server_thread.start()
yield server_thread
server_thread.join()
def test():
with server_context():
response = requests.get('http://localhost:8080/start')
requests.get('http://localhost:8080/', timeout=0.05) (passes with The relevant (it could be that it fixes a genuine threading bug that exposes a problem in Edit: further simplified the repro case |
Ok: I think that this is a result of the use of non-threaded HTTP webservers during unit testing; not a problem within the (updating the repro case provided previously to swap-out the single-threaded |
Describe the bug
Currently the
requests
library,as of version 2.30.0(self-correction: this should have been 'as of version 2.29.0'; I had not read some of the updates in the linked thread), does not supporturllib3
versions greater than 2.0.0 - including the most recenturllib3
releases on PyPi.Sphinx doesn't have any explicit dependencies on
urllib3
, so it's pulled in by default duringpip install
and uses the latest-available-version.How to Reproduce
The test failures (request timeouts) in #11392 appear to be related to this incompatibility.
Placing an upper-bound constraint on the
urllib3
version to avoid 2.x package installs (for example,urllib3<2.0.0
) resolves the failures; I'll push a demonstration commit to the pull request branch to illustrate that.Environment Information
Sphinx extensions
Additional context
No response
The text was updated successfully, but these errors were encountered: