awslabs / aws-shell

An integrated shell for working with the AWS CLI.
Apache License 2.0
7.19k stars 773 forks source link

UnicodeDecodeError #115

Closed Skyfold closed 8 years ago

Skyfold commented 8 years ago

Just installed aws-shell on osx 10.10.5 using Python 2.7.10. I get this error upon openings aws-shell. It does not crash the shell or seem to affect any normal functionality. I installed using sudo pip install aws-shell --upgrade --ignore-installed six.

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/awsshell/makeindex.py", line 84, in write_doc_index
    do_write_doc_index(db, help_command, close_db_on_finish=should_close)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/awsshell/makeindex.py", line 89, in do_write_doc_index
    _index_docs(db, help_command)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/awsshell/makeindex.py", line 107, in _index_docs
    _index_docs(db, sub_help_command)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/awsshell/makeindex.py", line 104, in _index_docs
    text_docs = render_docs_for_cmd(sub_help_command)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/awsshell/makeindex.py", line 113, in render_docs_for_cmd
    help_command(None, None)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/awscli/help.py", line 264, in __call__
    self.renderer.render(self.doc.getvalue())
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/botocore/docs/bcdoc/restdoc.py", line 78, in getvalue
    return ''.join(self._writes).encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 49: ordinal not in range(128)
arnau commented 8 years ago

Same happened to me.

OS: 10.11.4 Python: 2.7.11 pip: 8.1.1

Installed via:

pip install aws-shell --upgrade --ignore-installed six
danoyoung commented 8 years ago

We're seeing the same thing on EMR.

(looker-emr)[ec2-user]$ aws-shell
Creating doc index in the background. It will be a few minutes before all documentation is available. aws> Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib64/python2.7/threading.py", line 813, in *bootstrap_inner self.run() File "/usr/lib64/python2.7/threading.py", line 766, in run self.__target(_self.__args, _self.kwargs) File "/home/ec2-user/.envs/looker-emr/local/lib/python2.7/dist-packages/awsshell/makeindex.py", line 84, in write_doc_index do_write_doc_index(db, help_command, close_db_on_finish=should_close) File "/home/ec2-user/.envs/looker-emr/local/lib/python2.7/dist-packages/awsshell/makeindex.py", line 89, in do_write_doc_index
_index_docs(db, help_command) File "/home/ec2-user/.envs/looker-emr/local/lib/python2.7/dist-packages/awsshell/makeindex.py", line 107, in _index_docs _index_docs(db, sub_help_command) File "/home/ec2-user/.envs/looker-emr/local/lib/python2.7/dist-packages/awsshell/makeindex.py", line 104, in _index_docs text_docs = render_docs_for_cmd(sub_help_command) File "/home/ec2-user/.envs/looker-emr/local/lib/python2.7/dist-packages/awsshell/makeindex.py", line 113, in render_docs_for_cmd help_command(None, None) File "/home/ec2-user/.envs/looker-emr/local/lib/python2.7/dist-packages/awscli/help.py", line 264, in
call** self.renderer.render(self.doc.getvalue()) File "/home/ec2-user/.envs/looker-emr/local/lib/python2.7/dist-packages/botocore/docs/bcdoc/restdoc.py", line 78, in getvalue return ''.join(self._writes).encode('utf-8') UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 49: ordinal not in range(128)

aws>

jamesls commented 8 years ago

What version of the AWS CLI do you have (aws --version)? I suspect this may be related to a recent release that pulled in some documentation with non ascii chars .

If that's the case, this should be fixed with the next release of the AWS CLI (https://github.com/aws/aws-cli/pull/1882).

arnau commented 8 years ago

aws-cli/1.10.17 Python/2.7.11 Darwin/15.4.0 botocore/1.4.8

Skyfold commented 8 years ago

The error was caused on: aws-cli/1.10.17 Python/2.7.10 Darwin/14.5.0 botocore/1.4.8

The new version of aws-cli is not on brew yet, nor is it on pip. Pip says there is a new version "10.10.1", but when I pip install --upgrade awscli and run aws --version I get 10.10.17. The same error is still present.

I will try the development branch later and see if that fixes it.

danoyoung commented 8 years ago

aws-cli/1.10.17 Python/2.7.10 Linux/4.1.10-17.31.amzn1.x86_64 botocore/1.4.8

vonec commented 8 years ago

aws-cli/1.10.17 Python/2.7.6 Linux/3.13.0-74-generic botocore/1.4.8

jbrodley commented 8 years ago

Same issue aws-cli/1.10.17 Python/2.7.11 Darwin/15.4.0 botocore/1.4.8

jamesls commented 8 years ago

Ok, we'll get a new CLI release out that should fix this issue. I'll also update the doc generator to be more robust when cases like this happen.

I'll update this issue once a CLI release is out.

joshuadsilva commented 8 years ago

Same issue aws-cli/1.10.17 Python/2.7.11 Darwin/15.2.0 botocore/1.4.8

danoyoung commented 8 years ago

Just a FYI, I upgraded today and it looks good so far!

arnau commented 8 years ago

All good here too :+1:

joshuadsilva commented 8 years ago

Works for me too :+1:

Skyfold commented 8 years ago

Fixed

vonec commented 8 years ago

Fixed