donnemartin / saws

A supercharged AWS command line interface (CLI).
Other
5.24k stars 281 forks source link

UnicodeDecodeError: 'ascii' codec can't decode byte #56

Open ghost opened 8 years ago

ghost commented 8 years ago

Hi,

I just installed SAWS on my local machine on which I already used the AWS CLI before. (Thus it should be configured correctly) After starting SAWS I got the following output:

No resource cache found
Refreshing resources...
  Refreshing instance ids...
  Refreshing instance tags...
Traceback (most recent call last):
  File "/usr/local/bin/saws", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/saws/main.py", line 39, in cli
    saws = Saws()
  File "/usr/local/lib/python2.7/dist-packages/saws/saws.py", line 93, in __init__
    shortcut_match=self.get_shortcut_match())
  File "/usr/local/lib/python2.7/dist-packages/saws/completer.py", line 95, in __init__
    self.refresh_resources()
  File "/usr/local/lib/python2.7/dist-packages/saws/completer.py", line 133, in refresh_resources
    self.resources.refresh(force_refresh)
  File "/usr/local/lib/python2.7/dist-packages/saws/resources.py", line 149, in refresh
    self.query_instance_tag_values()
  File "/usr/local/lib/python2.7/dist-packages/saws/resources.py", line 205, in query_instance_tag_values
    self.instance_tag_values = set(output.split('\t'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 9953: ordinal not in range(128)

I'm using Ubuntu 14.04 with aws --version: aws-cli/1.8.12 Python/2.7.6 Linux/3.13.0-65-generic

donnemartin commented 8 years ago

@broegner nice catch, thanks for the bug report. Seems to be failing on special characters on your instance tags.

donnemartin commented 8 years ago

@broegner I can confirm that it's a special character issue.

For me this only seems to happen on Python 2 and not on Python 3. If you're able to run Python 3 that could be a workaround until this bug is fixed.