-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot write the dashboard: 'ascii' codec can't encode characters in position 5-7: ordinal not in range(128) #50
Comments
@mohit3112 are you able to identify which is the module that causes this error? You can figure this out by disabling all modules then enabling one at a time. Also, what is it supposed to print? Thank you. |
@cyrus-and |
ok so i just did following
to check the version of python used , out put is 3.4.0 but when i do python --version , i get 2.7.4 |
OK, it's normal, the Python version used by GDB may be different from the system-wide version. |
Does this happen with every file you are trying to debug? For example try the following:
You should see the dahboard. |
@cyrus-and |
Oh, I see, I can reproduce that now. |
Can you try to run: python -c "import sys; print(sys.stdout.encoding)" and: echo $LANG in your shell where you usually run GDB and get the error? |
first one gives : UTF-8 |
I can only reproduce your issue on a machine where the locale is set to export LC_CTYPE=C.UTF-8 For example: $ gdb -nx -ex 'python with open("/dev/null") as f: print(f.encoding)' -ex quit
ANSI_X3.4-1968
$ export LC_CTYPE=C.UTF-8
$ gdb -nx -ex 'python with open("/dev/null") as f: print(f.encoding)' -ex quit
UTF-8 Can you try to run: gdb -nx -ex 'python with open("/dev/null") as f: print(f.encoding)' -ex quit |
yep i got ANSI_X3.4-1968, i tried to export LC_CTYPE=C.UTF-8 and it worked !! |
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 alias gdb='LC_CTYPE=C.UTF-8 gdb' I'm closing this for now. Thanks for your patience! |
From this comment:
GDB 7.7 with Python
2.7.43.4.0The text was updated successfully, but these errors were encountered: