[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: [versions=Python 3.2,Python 3.1,Python 2.7;nosy:+akuchling] Reply-To: In-Reply-To: <1300905163.47.0.72975942018.issue11...@psf.upfronthosting.co.za> On Wed, Mar 23, 2011 at 06:32:43PM +, Charles-Francois Natali wrote: > my_fgets Parser/myreadline.c

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Davide Rizzo
Davide Rizzo added the comment: The patch works fine, thank you. I was trying the same fix, but got stuck trying to understand what led to the decision in issue 960406. Still not sure. -- ___ Python tracker

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Charles-Francois Natali
Charles-Francois Natali added the comment: my_fgets in Parser/myreadline.c is broken: There's a comment saying that a fgets is retried on EINTR, but the code doesn't retry. It used to in older cPython versions, but there was also a bug, so my guess is that this bug has been here for a long tim

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Davide Rizzo
Davide Rizzo added the comment: You are right. The previous runs were without readline. With readline it behaves as expected. For the sake of completeness, here's the output of your snippet after Ctrl+Z, fg: getchar: Interrupted system call -- ___

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Charles-Francois Natali
Charles-Francois Natali added the comment: In that case, it's likely due to the way OS-X handles interrupted syscalls. Under Linux, getchar and friends (actually read with default SA_RESTART) won't return EINTR on (SIGSTOP|SIGTSTP)/SIGCONT. Under OS-X, it seems that e.g. getchar (read) does ret

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: The exit status code is always 0. It seems to me somewhere in a run() somebody sets some 'do exit' and thus causing a normal exit. But i really can't find something down in pythonrun.c at a short glance (and i just dived shallow into Python yet), and

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Davide Rizzo
Davide Rizzo added the comment: The process did exit on fg. Compare with the 2nd paste on my previous message (Python shipped with OS X). -- ___ Python tracker ___

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Charles-Francois Natali
Charles-Francois Natali added the comment: I'm still not sure I understand the problem. - when you hit CTRL-Z, the process is put in background, since it receives a SIGTSTP : normal - when you put it in foreground with 'fg', it doesn't resume ? Did you try to hit to have sys.ps1 '>>> ' printe

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Davide Rizzo
Davide Rizzo added the comment: davide@macrisorto ~/cpython $ ./python.exe Python 3.3a0 (default:4a5782a2b074, Mar 23 2011, 15:26:35) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ^Z [1]+ Stopped

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: On Wed, Mar 23, 2011 at 02:05:46PM +, Charles-Francois Natali wrote: > import signal > signal.signal(signal.SIGTSTP, signal.SIG_IGN) 15:27 ~/tmp $ python3 Python 3.3a0 (default:4a5782a2b074, Mar 21 2011, 15:20:28) [GCC 4.2.1 (Apple Inc. build 5664)

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: On Wed, Mar 23, 2011 at 02:05:46PM +, Charles-Francois Natali wrote: > What's the problem here ? > CTRL-Z causes the controlling terminal to send a SIGTSTP to the process, and > the default handler stops the process, pretty much like a SIGSTOP. > If

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Charles-Francois Natali
Charles-Francois Natali added the comment: What's the problem here ? CTRL-Z causes the controlling terminal to send a SIGTSTP to the process, and the default handler stops the process, pretty much like a SIGSTOP. If you don't want that to happen: import signal signal.signal(signal.SIGTSTP, sign

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: 8) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: On Wed, Mar 23, 2011 at 01:44:06PM +, Ezio Melotti wrote: > On linux it looks the same for me, but when I press enter the prompt appears > again: 14:49 ~ $ jobs 14:49 ~ $ python3 Python 3.3a0 (default:4a5782a2b074, Mar 21 2011, 15:20:28) [GCC 4.2.

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Ezio Melotti
Ezio Melotti added the comment: On linux it looks the same for me, but when I press enter the prompt appears again: $ ./python Python 3.3a0 (default:f8d6f6797909, Mar 20 2011, 05:55:16) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> [1]+ Stop

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Steffen Daode Nurpmeso
Steffen Daode Nurpmeso added the comment: On Wed, Mar 23, 2011 at 01:38:46PM +, STINNER Victor wrote: > I don't have this behaviour on Linux. Is it specific to Mac OS X? (Wish i could tell ;-) -- ___ Python tracker

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread STINNER Victor
STINNER Victor added the comment: I don't have this behaviour on Linux. Is it specific to Mac OS X? -- nosy: +haypo ___ Python tracker ___ __

[issue11650] CTRL-Z causes interpreter exit

2011-03-23 Thread Steffen Daode Nurpmeso
New submission from Steffen Daode Nurpmeso : 14:23 ~ $ python3 Python 3.3a0 (default:4a5782a2b074, Mar 21 2011, 15:20:28) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ^Z [1]+ Stopped python3 14:25 ~ $ 14: