ezmomi icon indicating copy to clipboard operation
ezmomi copied to clipboard

Properly encode Unicode

Open elfranne opened this issue 6 years ago • 0 comments

Ezmomi crashes when using unicode in the name of a VM ( and maybe other places too ? ) Installed ezmomi version 6.4.0 via pip

ezmomi list --type VirtualMachine 14:31:57 /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py:789: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html InsecureRequestWarning) VirtualMachine list MOID Name Status
[list of virtual machines]

Traceback (most recent call last): File "/usr/local/bin/ezmomi", line 4, in cli.cli() File "/usr/local/lib/python2.7/dist-packages/ezmomi/cli.py", line 16, in cli ez.list_objects() File "/usr/local/lib/python2.7/dist-packages/ezmomi/ezmomi.py", line 155, in list_objects self.print_as_table(rows) File "/usr/local/lib/python2.7/dist-packages/ezmomi/ezmomi.py", line 618, in print_as_table print format.format(*row) UnicodeEncodeError: 'ascii' codec can't encode character u'\xf8' in position 0: ordinal not in range(128)

NB: \xf8 is ø (a letter used in danish)

elfranne avatar Jan 29 '18 13:01 elfranne