Summary: python readline woes Classification: openSUSE Product: openSUSE 11.1 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: email@example.com ReportedBy: firstname.lastname@example.org QAContact: email@example.com Found By: ---
to my surprise, "import readline" produces some output on stdout, even if stdout is not a terminal (e.g. a pipe, or written to file).
atuin > TERM=xterm python -c "import readline" | hexdump -C 00000000 1b 5b 3f 31 30 33 34 68 |.[?1034h| 00000008
this is related to TERM=xterm (does not happen for vt100/linux/).
this esc sequence comes from the following terminfo value
atuin readline-5.1 > infocmp -1 | grep smm smm=\E[?1034h,
which is available since SUSE 10.3.
python in 10.2 and older does not output anything, python in 10.3 and newer does output.
now I'm using something like
if sys.stdout.isatty(): import readline
in sitecustomize.py but IMHO that's a bug in python (or even readline ?). if output does not go to a terminal, there should be not esc sequences in output...