[issue28373] input() prints to original stdout even if sys.stdout is wrapped

2016-10-10 Thread Adam Bartoš
Adam Bartoš added the comment: Does GNU readline do anything fancy about printing the prompt? Because you may want to use GNU readline for autocompletition while still enable colored output via wrapped stdout. Both at the same time with one call to input(). It seems that currently either you

[issue28373] input() prints to original stdout even if sys.stdout is wrapped

2016-10-09 Thread Martin Panter
Martin Panter added the comment: >From memory, there are at least three code paths for input(): 1. Fallback implementation, used when stdout is a pipe or other non-terminal 2. Default PyOS_ReadlineFunctionPointer() hook, used when stdout is a terminal:

[issue28373] input() prints to original stdout even if sys.stdout is wrapped

2016-10-06 Thread Adam Bartoš
Adam Bartoš added the comment: Other related issues are #1927 and #24829. -- ___ Python tracker ___ ___

[issue28373] input() prints to original stdout even if sys.stdout is wrapped

2016-10-06 Thread Adam Bartoš
Adam Bartoš added the comment: A related issue is that the REPL doesn't use sys.stdin for input, see #17620. Another related issue is #28333. I think that the situation around stdio in Python is complicated an inflexible (by stdio I mean all the interactions between REPL, input(), print(),

[issue28373] input() prints to original stdout even if sys.stdout is wrapped

2016-10-06 Thread Arnon Yaari
New submission from Arnon Yaari: When I wrap sys.stdout with a custom object that overrides the 'write' method, regular prints use the custom write method, but the input() function prints the prompt to the original stdout. This is broken on Python 3.5. Earlier versions work correctly. In the