'charmap' codec can't encode character (Windows 7)
Platform: Windows 7 Entreprise SP1. installed from MSI.
C:>aws --profile lg-sec --region ap-southeast-2 cloudtrail create-trail help
'charmap' codec can't encode character u'\u2019' in position 1686: character maps to
C:>aws --version aws-cli/1.6.10 Python/2.7.5 Windows/7
Looks like this is a known issue with windows/cmd/python, which goes pretty far back: http://bugs.python.org/issue1602
This is going to be difficult to solve, especially if some of the underlying issues stem from python. Perhaps the best interim solution would be to add a config option to escape the non-ascii unicode sequences, similar to what JSON can do, e.g. "foo\u2713bar". This will at least be better than crashing mid way through formatting the output.
Although we don't have the --debug output to confirm, the symptom is most likely caused by some non-ascii character (in this case, it is the u'\u2019', single quote) can not be displayed on the current locale. For example, if your locale is using CP437 encoding, you will see the same symptom.
>>> u'\u2019'.encode('cp437')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/rayluo/py27/lib/python2.7/encodings/cp437.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u2019' in position 0: character maps to <undefined>
We haven't implemented the interim solution yet. But I believe the symptom has gone for a while, because the problematic single quote in our service model at that time has long been changed to normal single quote already. I think we can close this issue for now.
Using s3 for backups, I am powerless to the encoding of the file names. This is frustrating.
Yes, what's the status on this - I can't control the files names and am running into this as well
+status