Open aisk opened 6 months ago
That's because editline used by the basic REPL. We'll address this in the betas.
See also, https://github.com/python/cpython/issues/102130#issuecomment-1675826220 (may ignore some of my argument in the url. But take the examples or links or symptoms. The handling for encoding part in my example code is just wrong.)
it looks like the problem is deeper than thought...
# print_all_printable_unicode.py
# https://stackoverflow.com/a/77352299/20307768
for i in range(0x0000, 1 + 0xffff, 1):
if str.isprintable(chr(i)):
print(chr(i))
mv ~/.python_history ~/.python_history.bak
echo "_HiStOrY_V2_" > ~/.python_history > ~/.python_history.utf8
python print_all_printable_unicode.py >> ~/.python_history >> ~/.python_history.utf8
~/.python_history
)
python
vim -d ~/.python_history ~/.python_history.utf8
Bug report
Bug description:
When using the version of Python (3.9.6) that comes with Apple at
/usr/bin/python
, or when installing the latest version of Python (3.12.3) via Homebrew, the readline functionality is based on libedit. There is a file ~/.python_history that stores the REPL history, and its content is similar to:When using the latest version of Python built from the main branch, which includes the new REPL, pressing the up arrow key will display:
The '\04' is not converted to space character.
CPython versions tested on:
3.13
Operating systems tested on:
macOS Sonoma 14.2
Linked PRs