-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Fixed non-ascii error when using COMPOSE_DOCKER_CLI_BUILD=1 for Buildkit #6982
Conversation
Please sign your commits following these rules: $ git clone -b "fix_non_ascii_error" [email protected]:smamessier/compose.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. |
ffcca7e
to
af89c05
Compare
thanks! ping @chris-crone PTAL |
This seems to only work on Python 2.7 let me fix this. |
Signed-off-by: Sebastien Mamessier <[email protected]>
af89c05
to
a3a23bf
Compare
Looks to be green now 👍. I'm not a maintainer in this repository; wondering if we can / should have a test for this (not sure if that's possible, but just brainstorming 😂) @ndeloof @chris-crone ptal |
You're right. Ideally we should add a test that breaks without this patch. I'm not a maintainer either so that would take me quite a bit of time to get into that. |
I'm +0 on this as I'm a perfect python newbie :) |
I realized this patch may not be necessary. I was basically trying to use compose's master using
This probably assumes When I install |
We do support python 2.7 but should consider to stop with it, especially with python 2 EOL on January 1st 2020. |
So should we merge this? |
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.
Thank you @smamessier !
Could you please add a test for it. I just fear that someone can take this out believing that's unnecessary.
Actually just adding an
So that's even easier to take this off when we execute #6890 I can do that now, and we are good to merge |
Signed-off-by: Ulysses Souza <[email protected]>
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.
LGTM
Thanks a lot! |
Thank you @smamessier for the catch! |
When using
on compose's master, with docker version 18.09.8
I'm getting
which can be traced back to this line: https://github.com/docker/compose/blob/master/compose/service.py#L1809
The problem seems to be that the line read form
stdin
has non-ascii characters and.startswith
fails when comparing a raw string with the unicode prefixmagic_word
.The culprit input line (which is part of the output of
docker build
) iswhich contains the utf-8 µ character:
\xc2\xb5
.startswith
errors out as the prefixmagic_word
is a unicode string.This fixes the problem by encoding magic_word before making the comparison.