Issue 34785: pty.spawn -- auto-termination after child process is dead (a zombie) (original) (raw)

Issue34785

Created on 2018-09-24 07:25 by jarryshaw, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pty-diff.patch jarryshaw,2018-09-24 07:25 git diff patch file of Lib/pty.py
Pull Requests
URL Status Linked Edit
PR 9525 closed jarryshaw,2018-09-24 08:10
Messages (4)
msg326206 - (view) Author: Jarry Shaw (jarryshaw) * Date: 2018-09-24 07:25
As in pty.spawn, once started, the parent process will be hanged, even if the child process is already dead (or a zombie), and must wait for a KeyboardInterrupt or else to terminate the whole process. Thus, I propose to revise `_copy` function, where the parent process hung, to check if the child process is dead periodically and if so, terminate the whole process then return as shown in the patch file.
msg326695 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2018-09-29 23:09
Is this to get “spawn” working on a non-Linux platform like a recent Free BSD, OS X, or Solaris? If so, see Issue 26228. If not, you might have to explain your use case better. Polling for the child exiting is going to race with handling the child’s output, and if there are other processes writing to the terminal after the child exits this will change the behaviour.
msg336267 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2019-02-21 22:21
Suggest closing this assuming it is a duplicate, unless Jarry can give more information.
msg336598 - (view) Author: Jarry Shaw (jarryshaw) * Date: 2019-02-26 03:03
This issue is duplicated with , sorry.
History
Date User Action Args
2022-04-11 14:59:06 admin set github: 78966
2019-02-26 03:03:58 jarryshaw set status: pending -> closedmessages: + stage: patch review -> resolved
2019-02-21 22:21:58 martin.panter set status: open -> pendingsuperseder: pty.spawn hangs on FreeBSD 9.3, 10.x, 12.1resolution: duplicatemessages: +
2018-09-29 23:09:21 martin.panter set nosy: + martin.pantermessages: +
2018-09-24 08:10:12 jarryshaw set stage: patch reviewpull_requests: + <pull%5Frequest8930>
2018-09-24 07:25:19 jarryshaw create