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
Chinese characters issue with input() function #77873
Comments
DIRECTLY run(i.e., python xxx/xxx/input_test.py) the file below and input other Chinese characters, then press backspace to delete them. You will find that you cannot delete them all, and even the cursor in the terminal misplaces and overlaps with the characters. This issue is only reproduced under Mac OS X, everything is fine with Windows. |
input() uses readline. On macOS, readline is provided by libedit. It may be a bug in libedit which is an external dependency, and so not maintained by Python. |
I could reproduce the behavior that console output doesn't match what Python gets. I agree with Victor this may not be a Python problem. I could also reproduce the behavior with Ruby reading Chinese characters from console. |
FTR:
It *may* be provided by libedit. GNU readline is also commonly used on macOS, although it is not provided by Apple. The easiest way to tell which is in use is to examine the __doc__ attribute of the readline module: $ /usr/local/bin/python3.6 -c 'import readline;print(readline.__doc__)'
Importing this module enables command line editing using libedit readline.
$ /macports/bin/python3.6 -c 'import readline;print(readline.__doc__)'
Importing this module enables command line editing using GNU readline. https://docs.python.org/3/library/readline.html#module-readline |
Xiang Zhang, was that on macOS? If so, can someone try on one or more Linux systems with a Chinese locale? I see the same behavior on Linux but I'm not sure that I'm testing it properly. |
Yes, it's on MacOS. libedit and GNU deadline both have the behavior. I can see the same behavior on Ubuntu, LANG=en_US.UTF-8. |
So it's not a macOS-specific issue: editing the title et al accordingly |
Hello everyone, do we have a walkaround for this issue now? I barely read your discussion. |
Hey there! I saw your pull requests to python3.6 and have been merged, so what should we do now? Just update the python to higher a version? |
Oh. My changes are just to add debug traces in the "python3 -m test.pythoninfo" command which is used on buildbots, Travis CI and AppVeyor to ease debug when a test fails. It's not a fix. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: