STINNER Victor <victor.stin...@haypocalc.com> added the comment:

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
./python
2<ENTER>
2
----------
"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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11650>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to