Author vstinner
Recipients akuchling, davide.rizzo, ezio.melotti, jesstess, mwh, neologix, python-dev, sdaoden, vstinner
Date 2011-04-09.14:18:00
SpamBayes Score 7.08564e-08
Marked as misclassified No
Message-id <>
I emulated Mac OS X behaviour on Linux by hacking my_fgets(): do { p=NULL; errno = EINTR; }, only after the first call to fgets(). Without the patch, Python does exit immediatly. With the patch, Python doesn't exit.

I applied neologix's patch to 3.1, 3.2, 3.3 and 2.7: thank you Charles-Francois!

Can someone retest on Mac OS X?

I noticied a strange behaviour:
$ python
>>> 1+^Z
[1]+  Stopped                 ./python
$ fg
"1+2" input becomes "2". But we can not do better because buf doesn't contain "1+\0" when fgets() is interrupted.

Note: If the readline module is available, it is used, and readline doesn't have this issue. And "1+^Z(...)2" gives 3 with readline.
Date User Action Args
2011-04-09 14:18:01vstinnersetrecipients: + vstinner, mwh, akuchling, ezio.melotti, jesstess, neologix, davide.rizzo, sdaoden, python-dev
2011-04-09 14:18:01vstinnersetmessageid: <>
2011-04-09 14:18:00vstinnerlinkissue11650 messages
2011-04-09 14:18:00vstinnercreate