-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
RestXMLSerializer has problem with multi-byte unicode strings py2.7 #868
Comments
I'm not sure why you deleted the body of the issue, so here's the steps to reproduce: import boto3
bucket = 'bucket-name'
key = u'日本語でおk'
s3 = boto3.client('s3')
s3.put_object(Bucket=bucket, Key=key)
# Results in a UnicodeEncodeError on 2.7
s3.delete_object(Bucket=bucket, Key=key) Thanks for reporting! |
@JordonPhillips Thank your follow-up. |
FWIW, I think this is only an issue on
|
In the rest xml parser, we were converting the input we recieve into a `str`, which was causing failures on python 2 when multibyte unicode strings were passed in. The fix is to simply use `six.text_type`, which is `unicode` on 2 and `str` on 3. The string will be encoded into the default encoding later on in the serializer. Fixes boto#868
Environment:
Reproduce:
Otherwise, pass with multi-byte non unicode string cause another exception.
At least, multi-byte string cannot be prohibited, I thought.
Fixes of the code will vary depending on which is right.
Needed the opinions.
The text was updated successfully, but these errors were encountered: