question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-97: character maps to <undefined>

See original GitHub issue

Hi,

New to Linode here. Just trying to run the command linode-cli linodes list and get this huge error.

Traceback (most recent call last):
  File "c:\users\user\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\user\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\user\AppData\Local\Programs\Python\Python37\Scripts\linode-cli.exe\__main__.py", line 9, in <module>
  File "c:\users\user\appdata\local\programs\python\python37\lib\site-packages\linodecli\__init__.py", line 424, in main
    cli.handle_command(parsed.command, parsed.action, args)
  File "c:\users\user\appdata\local\programs\python\python37\lib\site-packages\linodecli\cli.py", line 484, in handle_command
    operation.process_response_json(result.json(), self.output_handler)
  File "c:\users\user\appdata\local\programs\python\python37\lib\site-packages\linodecli\operation.py", line 185, in process_response_json
    handler.print(self.response_model, json)
  File "c:\users\user\appdata\local\programs\python\python37\lib\site-packages\linodecli\output.py", line 45, in print
    self._table_output(header, data, columns, title, to)
  File "c:\users\user\appdata\local\programs\python\python37\lib\site-packages\linodecli\output.py", line 100, in _table_output
    print(tab.table, file=to)
  File "c:\users\user\appdata\local\programs\python\python37\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-97: character maps to <undefined>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Dorthucommented, Dec 2, 2019

That error suggests that some character coming back is not encoding correctly in the “Windows-1252” character encoding. I assume this is related to a unicode character in one of your Linode labels. Ideally, the CLI would force encoding to unicode for all output to prevent these errors. I don’t have ready access to a windows machine to reproduce this on, but I’ll try to get a fix posted before tomorrow’s scheduled CLI release.

1reaction
rszemplinskicommented, Dec 2, 2019
linode-cli 2.10.3
Built off spec version 4.9.0
Read more comments on GitHub >

github_iconTop Results From Across the Web

UnicodeEncodeError: 'charmap' codec can't encode characters
The reason why it is working is because the encoding is changed to UTF-8 when using the file, so characters in UTF-8 are...
Read more >
UnicodeEncodeError: 'charmap' codec can't encode character ...
UnicodeEncodeError : 'charmap' codec can't encode character u'\u2026' in position 139: character maps to <undefined> #1.
Read more >
'charmap' codec can't encode characters in position 0-14 ...
Hi! How to solve "UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-14: character maps to " for this code: stockList ...
Read more >
'charmap' codec can't encode characters in position 49-50
“return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 49-50: character maps ...
Read more >
Character Issues - | notebook.community
... def decode(self,input,errors='strict'): UnicodeEncodeError: 'charmap' codec can't encode character '\xe3' in position 1: character maps to <undefined>.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found