[issue24829] Use interactive input even if stdout is redirected

2021-03-15 Thread Eryk Sun
Change by Eryk Sun : -- dependencies: +Python interactive console doesn't use sys.stdin for input versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6 ___ Python tracker

[issue24829] Use interactive input even if stdout is redirected

2015-09-01 Thread Adam Bartoš
Adam Bartoš added the comment: How about reconsidering in the case that the machinery around PyOS_Readline is rewritten as I suggest in #17620 ? -- ___ Python tracker

[issue24829] Use interactive input even if stdout is redirected

2015-08-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: I recommend this feature request be rejected. The current behavior has been in place for a long time. Changing it may cause more harm than good (especially if the behavior between operating systems becomes more divergent). -- nosy: +rhettinger

[issue24829] Use interactive input even if stdout is redirected

2015-08-28 Thread eryksun
eryksun added the comment: If you dropped the isatty() check for stdout in Linux, you may end up with the output of Readline in the file (assuming Readline is okay with this). The file would include all the cursor positioning codes, backspaces, etc, that Readline generates. But I haven’t

[issue24829] Use interactive input even if stdout is redirected

2015-08-25 Thread Martin Panter
Martin Panter added the comment: In Linux, the original stdin, stdout, stderr file descriptors refer to the same console by default, and you use normal file reads and writes on them. In Linux when Python uses Gnu Readline, the displayed input characters are indeed written to the original

[issue24829] Use interactive input even if stdout is redirected

2015-08-24 Thread Martin Panter
Martin Panter added the comment: I think Gnu Readline uses standard output for echoing input, prompts, controlling the cursor, etc. You can already see this by redirecting to a separate terminal. In Linux: $ python /dev/pts/2 So I think your assumption is not valid. Perhaps you can redirect

[issue24829] Use interactive input even if stdout is redirected

2015-08-08 Thread Adam Bartoš
New submission from Adam Bartoš: Currently, if one redirects stdout, readline hook is not used (see https://hg.python.org/cpython/file/default/Parser/myreadline.c#l208). I would assume that if I run Python as py -i output.txt, I can use GNU readline or other readline hook for input just like