Skip to content

Conversation

timvisee
Copy link
Contributor

@timvisee timvisee commented Nov 2, 2017

docker-py is having trouble with requests<2.14 because it may use an old version of chardet. Some new function is used that does not exist in older versions of the dependency, causing it to crash in some cases.

When using docker-py with Ansible, using modules like docker_network result in an error with old versions of chardet installed. These errors are resolved when using chardet>=3.0. requests now requires this version since 2.14.

This problem would only happen if an earlier version of requests was already installed by some other package, where the version was still satisfied by the current docker-py configuration and was below 2.14. When the dependency is freshly installed, this problem would not occur as a version higher than 2.14 would be chosen.

It could be manually fixed by installing chardet>=3.0.1 in the command line using pip, but this is of course not desired.

Therefore I've changed the configuration to require at least requests>=2.14.2 (where the patch version .2 fixed some bugs) to fix this issue as a whole.

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "chardet-fix" git@github.com:timvisee/docker-py.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

Signed-off-by: timvisee <timvisee@gmail.com>
@timvisee
Copy link
Contributor Author

timvisee commented Nov 2, 2017

I've signed the commit now. The PR has been updated.

@shin-
Copy link
Contributor

shin- commented Nov 7, 2017

Thanks!

Putting a pin in this, because it'll conflict with the docker-compose requirements, but we should be able to reconcile.

@timvisee
Copy link
Contributor Author

timvisee commented Nov 7, 2017

Thank you for looking into it.

Hmm, maybe a temporary fix could be to require the proper chardet version explicitly in docker-py. Although, I don't think such a thing is recommended.

@shin-
Copy link
Contributor

shin- commented Dec 14, 2017

Should be good now. Thank you!

@shin- shin- merged commit 6c74292 into docker:master Dec 14, 2017
@shin- shin- added this to the 2.7.0 milestone Dec 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants