Skip to content
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

support urllib3 > 2 #74

Open
cdent opened this issue Mar 16, 2024 · 1 comment
Open

support urllib3 > 2 #74

cdent opened this issue Mar 16, 2024 · 1 comment
Labels

Comments

@cdent
Copy link
Owner

cdent commented Mar 16, 2024

A while ago we pinned to urlib3<2 because the interface changed a bit.

It turns out that updating to >2 is harder than expected, seeing errors in tests like

_____________________________________________________________________________ test_https _____________________________________________________________________________
wsgi_intercept/tests/test_urllib3.py:59: in test_https
    resp = http.request(
.tox/py311/lib/python3.11/site-packages/urllib3/_request_methods.py:136: in request
    return self.request_encode_url(
.tox/py311/lib/python3.11/site-packages/urllib3/_request_methods.py:183: in request_encode_url
    return self.urlopen(method, url, **extra_kw)
.tox/py311/lib/python3.11/site-packages/urllib3/poolmanager.py:444: in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
.tox/py311/lib/python3.11/site-packages/urllib3/connectionpool.py:772: in urlopen
    conn = self._get_conn(timeout=pool_timeout)
.tox/py311/lib/python3.11/site-packages/urllib3/connectionpool.py:295: in _get_conn
    return conn or self._new_conn()
.tox/py311/lib/python3.11/site-packages/urllib3/connectionpool.py:1073: in _new_conn
    return self.ConnectionCls(
wsgi_intercept/_urllib3.py:53: in __init__
    WSGI_HTTPSConnection.__init__(self, *args, **kwargs)
wsgi_intercept/__init__.py:584: in __init__
    super().__init__(*args, **kwargs)
/opt/homebrew/Cellar/python@3.11/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py:1425: in __init__
    super(HTTPSConnection, self).__init__(host, port, timeout,
E   TypeError: HTTPSConnection.__init__() takes from 2 to 3 positional arguments but 5 positional arguments (and 1 keyword-only argument) were given

which I've yet to untangle. Because wsgi-intercept does heinous monkey-patching, it's hard to trace all the pieces.

@thomasgoirand
Copy link

Hi.
This patch set looks like working for me in Debian unstable, though I had to add:
kwargs.pop('ssl_context', None)
to pass all unit tests.

Hoping this help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants