Author marienz
Recipients christian.heimes, gregory.p.smith, marienz, martin.panter
Date 2017-03-06.13:04:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488805488.65.0.499128377205.issue29700@psf.upfronthosting.co.za>
In-reply-to
Content
On Python 3, crash_readline_fdset.py does not crash for me, because its input() contains a check documented as:

       /* We should only use (GNU) readline if Python's sys.stdin and
          sys.stdout are the same as C's stdin and stdout, because we
          need to pass it those. */

and calls sys.stdin.getline() instead.

I don't understand why this was added (eba769657a32cb08d96f021f40c79a54ade0bffc's commit message "Make input9) behave properly with the new I/O library" does not explain it).

PyOS_Readline does still take sys_stdin and sys_stdout arguments, but the only callers in CPython itself pass the actual stdin and stdout. Not sure if it's still worth fixing (maybe just turn it from a crash into an error if the fd is too high, but don't add an alternative implementation?).

On Python 2, I can fix it, but then I hit the same problem in readline itself (http://git.savannah.gnu.org/cgit/readline.git/tree/input.c#n518).

So I suppose the next step is reporting it there, and see if they're interested in fixing it (looks like readline isn't currently using anything more fancy than select() and pselect(), and there's a few more calls to those that would probably also need fixing...). Doesn't seem useful to fix it here first.
History
Date User Action Args
2017-03-06 13:04:48marienzsetrecipients: + marienz, gregory.p.smith, christian.heimes, martin.panter
2017-03-06 13:04:48marienzsetmessageid: <1488805488.65.0.499128377205.issue29700@psf.upfronthosting.co.za>
2017-03-06 13:04:48marienzlinkissue29700 messages
2017-03-06 13:04:48marienzcreate