-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Make compatible with requests 2.29.0 and urllib3 2.0 #3116
Conversation
Signed-off-by: Felix Fontein <felix@fontein.de>
Failing CI (https://github.com/docker/docker-py/actions/runs/4861956711/jobs/8667665911?pr=3116) seems to be unrelated since it didn't fail before the force push (which only adjusted the commit message). Restarting CI. |
As a reference, the first test run that didn't fail: https://github.com/docker/docker-py/actions/runs/4861929164/jobs/8667601939 |
According to #3117 and #3113 (comment) this also fixes compatibility with urllib3 2.0, once requests officially supports that. |
…lib3. Signed-off-by: Felix Fontein <felix@fontein.de>
Signed-off-by: Felix Fontein <felix@fontein.de>
@milas can you take a look at this PR? Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I verified several scenarios under the integration tests (there are calls to put_archive
and I see the failures currently without this PR):
- requests 2.30.0 + urllib3 v2.x
- requests 2.28.x + urllib3 v1.x
- requests 2.30.0 + urllib3 v1.x
Looks good across the three. I'll get this merged and a new release tagged momentarily.
as done in JonasPammer/ansible-role-bootstrap#83 i think the whole reason i started said PR was because I wondered "why cap it at that without reason?". molecule-plugins[docker] brings the docker dep, with a fitting ">" delimiter which for example brings us docker/docker-py#3116 thus this PR closes #103
@pquentin @milas @felixfontein we facing the same issue like "TypeError: request() got an unexpected keyword argument 'chunked'" We are using docker as 5.0.3 and requests as 2.30.0 and urllib3 as 2.0.2. Is these versions fine or do we need to pin the version until the issue resolves? If we have to pin then please suggest to us the versions we need to resolve this issue |
@josephkishan You can keep requests 2.30.0 and urllib3 2.0.2, but you should upgrade docker to 6.1.0 or 6.1.1. |
…15050) Fix #14974 Refs: docker/docker-py#3116 Co-authored-by: Konstantin Vasin <126960927+k-v1@users.noreply.github.com>
Fixes at least part of #3113. (Recent requests versions declare that they need urllib3 < 2.0 since at least 2017, so the urllib3 problems themselves shouldn't really appear except when forcing invalid combinations of requests and urllib3. My hope is that the urllib3 2.0 compatibility is something that only needs changes on the side of requests, and not here - but who knows...)
Since requests 2.29.0, requests uses urllib3's native chunking ability (see psf/requests#6226). By using urllib3's
HTTPConnection
class (which extends httplib.HTTPConnection`) we make sure that our HTTP transports support this as well.I was able to reproduce the problem by calling
APIClient.put_archive()
; the change in this PR fixes the problem for me. (I'm working on a modified vendored version of Docker SDK for Python, so YMMV.)