Cannot write the dashboard: 'ascii' codec can't encode characters in position 5-7: ordinal not in range(128)
See original GitHub issueFrom this comment:
Traceback (most recent call last):
File "", line 357, in render
UnicodeEncodeError: 'ascii' codec can't encode characters in position 5-7: ordinal not in range(128)
GDB 7.7 with Python 2.7.4 3.4.0
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
'ascii' codec can't encode character : ordinal not in range (128)
Your problem is that, in Python 2, a file object (as returned by open() ) can only write str objects, not unicode objects....
Read more >'ascii' codec can't decode byte 0xe4 in position 11: ordinal not ...
Turns out the root cause of this issue is that the new pyparted build's python modules return unicode objects instead of (byte) strings...
Read more >ascii codec can't encode characters in position 57-65: ordinal not in ...
ascii codec can't encode characters in position 57 -65: ordinal not in range in range (128). Versions. OS: Windows 7 Professional Rus ...
Read more >Bug listing with status RESOLVED with resolution OBSOLETE ...
UTF-8 - UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 27: ordinal not in range(128): [...]" status:RESOLVED resolution:OBSOLETE ...
Read more >'ascii' codec can't encode character u'\u03b1' in position 20 ...
As the error message suggests the error is being caused because of encoding. · In csv files all values are separated by commas,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can only reproduce your issue on a machine where the locale is set to
C
, basically no locale, but I’m able to fix the behavior by exporting the UTF-8 variant before starting GDB, in my case:For example:
Can you try to run:
Good! Now, I’m not sure whether this is a thing I should fix myself or not, to my knowledge Python falls back to that encoding when it cannot figure out the proper encoding from the environment, so probably you’re experiencing this because your setup is not UTF-8-ready…
Anyway, you can use an alias, in your
.bashrc
or whatever so you don’t have to export it every time, plus in this way it will only affect GDB:I’m closing this for now. Thanks for your patience!