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 martin.panter
Recipients christian.heimes, gregory.p.smith, marienz, martin.panter, xiang.zhang
Date 2017-03-19.00:40:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489884035.49.0.583742088414.issue29700@psf.upfronthosting.co.za>
In-reply-to
Content
Marien’s pull request is for 2.7 and adds two new paths when raw_input is called:

* On Linux (actually glibc), use “poll” rather than “select”
* In other cases, if sys.stdin cannot be used with “select”, raise ValueError

Marien admits that even in the best case, some versions of the Readline library still crash because they use “select” themselves. Marien: can you identify which versions? Gnu Readline, or the wrapper in Editline? New versions vs superseded versions?

Assuming we add some catch-all behaviour like the ValueError, any further parts like the Linux “poll” implementation seem like new features, and are only appropriate for the next version of Python (3.7 atm). But it seems the bug would be hard to trigger in Python 3, so I doubt the Linux-specific implementation is worthwhile.

IMO the simplest solution may be to use one of the existing fallbacks if “select” is not usable. Either the other readline_until_enter_or_signal implementation (which hooks SIGINT rather than using the callback API), or PyOS_StdioReadline, or the raw_input fallback for non-interactive mode.

I would only bother with the complication of “poll” if there is a strong use-case. Gregory: do you really care if the “readline” module is used, or would a fallback like PyOS_StdioReadline be fine in your case (which is used if you never import the “readline” module)?
History
Date User Action Args
2017-03-19 00:40:35martin.pantersetrecipients: + martin.panter, gregory.p.smith, marienz, christian.heimes, xiang.zhang
2017-03-19 00:40:35martin.pantersetmessageid: <1489884035.49.0.583742088414.issue29700@psf.upfronthosting.co.za>
2017-03-19 00:40:35martin.panterlinkissue29700 messages
2017-03-19 00:40:35martin.pantercreate