[issue14440] Close background process if IDLE closes abnormally.
report at bugs.python.org
Tue Apr 3 05:47:52 CEST 2012
Roger Serwy <roger.serwy at gmail.com> added the comment:
This bug is related to issue12540. The approach taken there is to have the IDLE frontend explicitly kill the subprocess. It's a band-aid to the problem that run.py doesn't exit when the socket to the IDLE frontend closes (either by shell restart or kill -9 on IDLE).
Attached is a patch to cause the subprocess to exit. I have to admit not fully understanding why it works (on Ubuntu 11.04).
It looks like the following code in _getresponse() in rpc.py is what keeps the subprocess running:
while myseq not in self.responses:
I also tried disabling the "terminate_subprocess" in PyShell.py. With that change, the subprocess does not terminate on a shell restart (unless my patch is applied).
Andrew, Terry: What are your thoughts?
Added file: http://bugs.python.org/file25105/issue14440.patch
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list