This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Drekin
Recipients Drekin, wiggin15
Date 2016-10-06.10:23:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475749429.85.0.0944926596287.issue28373@psf.upfronthosting.co.za>
In-reply-to
Content
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(), sys.std* streams, sys.displayhook, sys.excepthook, C-level readline hooks). It would be nice to tidy up these interactions and document them at one place.

Currently, input() tries to detect whether sys.stdin and sys.stdout are interactive and have the right filenos, and handles the cases different way. I propose input() to be a thin wrapper (stripping a newline, generating EOFError) around proposed sys.readlinehook(). By default, sys.readlinehook would be GNU readline on Unix and stdio_readline (which just uses sys.stdout and sys.stdin) on Windows. I think that would fix all the problems like this one and changing/wrapping sys.std* streams would just work.

My proposal is at https://mail.python.org/pipermail/python-dev/2015-November/142246.html and there is discission at #17620. Recently, the related issue #1602 was fixed and there is hope there will be progress with #17620.
History
Date User Action Args
2016-10-06 10:23:49Drekinsetrecipients: + Drekin, wiggin15
2016-10-06 10:23:49Drekinsetmessageid: <1475749429.85.0.0944926596287.issue28373@psf.upfronthosting.co.za>
2016-10-06 10:23:49Drekinlinkissue28373 messages
2016-10-06 10:23:49Drekincreate