You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating System: OSX
softlayer-python version (slcli --version): 5.1.0
(cli) tony@Tonys-MBP ~VIRTUAL_ENV $ slcli image list > list2.txt ruby-2.0.0p645 tony@Tonys-MBP ~VIRTUAL_ENV $ less list2.txt [ruby-2.0.0p645]
An unexpected error has occured:
Traceback (most recent call last):
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/SoftLayer/CLI/core.py", line 163, in main
cli.main(*_kwargs)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, *_ctx.params)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/core.py", line 534, in invoke
return callback(_args, *_kwargs)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, _args[1:], *_kwargs)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/core.py", line 534, in invoke
return callback(_args, *_kwargs)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/SoftLayer/CLI/image/list.py", line 58, in cli
env.fout(table)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/SoftLayer/CLI/environment.py", line 56, in fout
self.out(self.fmt(output), newline=newline)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/SoftLayer/CLI/environment.py", line 51, in fmt
return formatting.format_output(output, fmt=self.format)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/SoftLayer/CLI/formatting.py", line 39, in format_output
return str(format_no_tty(data))
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 240, in str
return self.unicode().encode(self.encoding)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 243, in unicode
return self.get_string()
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 987, in get_string
formatted_rows = self._format_rows(rows, options)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 942, in _format_rows
return [self._format_row(row, options) for row in rows]
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 939, in _format_row
return [self._format_value(field, value) for (field, value) in zip(self._field_names, row)]
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 890, in _format_value
return self._unicode(value)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 179, in _unicode
value = str(value)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/SoftLayer/CLI/formatting.py", line 326, in str
return str(self.original)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)
* Better handles unicode in slcli for raw output
Closes#739.
* Added a test case that will return 'invalid' instead of failing outright
Also fixes a couple new style issues
* Make the unicode test just for python 2
Expected Behavior
output of CLI is piped to next command or file
Actual Behavior
CLI crashes
Environment Information
Operating System: OSX
softlayer-python version (
slcli --version
): 5.1.0(cli) tony@Tonys-MBP ~VIRTUAL_ENV $ slcli image list > list2.txt ruby-2.0.0p645 tony@Tonys-MBP ~VIRTUAL_ENV $ less list2.txt [ruby-2.0.0p645]
An unexpected error has occured:
Traceback (most recent call last):
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/SoftLayer/CLI/core.py", line 163, in main
cli.main(*_kwargs)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, *_ctx.params)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/core.py", line 534, in invoke
return callback(_args, *_kwargs)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, _args[1:], *_kwargs)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/click/core.py", line 534, in invoke
return callback(_args, *_kwargs)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/SoftLayer/CLI/image/list.py", line 58, in cli
env.fout(table)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/SoftLayer/CLI/environment.py", line 56, in fout
self.out(self.fmt(output), newline=newline)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/SoftLayer/CLI/environment.py", line 51, in fmt
return formatting.format_output(output, fmt=self.format)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/SoftLayer/CLI/formatting.py", line 39, in format_output
return str(format_no_tty(data))
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 240, in str
return self.unicode().encode(self.encoding)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 243, in unicode
return self.get_string()
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 987, in get_string
formatted_rows = self._format_rows(rows, options)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 942, in _format_rows
return [self._format_row(row, options) for row in rows]
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 939, in _format_row
return [self._format_value(field, value) for (field, value) in zip(self._field_names, row)]
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 890, in _format_value
return self._unicode(value)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/prettytable.py", line 179, in _unicode
value = str(value)
File "/Users/tony/alchemy/sl_exp/cli/lib/python2.7/site-packages/SoftLayer/CLI/formatting.py", line 326, in str
return str(self.original)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)
Feel free to report this error as it is likely a bug:
https://github.com/softlayer/softlayer-python/issues
The text was updated successfully, but these errors were encountered: