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

fix: build_parameter_query can't decode utf-8 charcters in parameters.py #218

Closed

Conversation

ainoya
Copy link

@ainoya ainoya commented Jan 23, 2014

Hi,
I found utf-8 probrem when I execute aws elasticbeanstalk create-application-version
with argument --description=[UTF-8 CHARACTERS].

It seems this bug is related to aws/aws-cli#593, so
I modify build_parameter_query in order to decode utf-8 characters.

Thanks.

@jamesls
Copy link
Member

jamesls commented Feb 28, 2014

I think the problem should be fixed in the CLI level. The build_parameter_query method should always require a unicode string. In python2, sys.argv is a byte string and we need to do the decoding ourself. In python3 this already happens, and I verified that the above example works without any issue. I'll send a PR to the CLI (and reference this issue) shortly.

@jamesls jamesls closed this Feb 28, 2014
jamesls added a commit to jamesls/aws-cli that referenced this pull request Feb 28, 2014
In python2, sys.argv is a bytestring of whatever encoding
is used by the terminal.  In python3, sys.argv is a list of unicode
strings.  This causes problems because the rest of the code assumes
unicode.

The fix is to automatically decode to unicode based on sys.stdin
as soon as we parse the args.

This was originally reported in aws#593, and
boto/botocore#218.

I'll need to more investigation to see if this problem applies
to JSON files via file://, this commit only fixes the case where
unicode is specified on the command line.
@ainoya
Copy link
Author

ainoya commented Mar 1, 2014

Oh, I didn't know CLI caused this. But now,I understand your PR and it fixes this problem.

Thank you for your consideration.

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.

2 participants