[issue17824] pty.spawn handles errors improperly
Martin Panter
report at bugs.python.org
Tue Oct 6 22:20:17 EDT 2015
Martin Panter added the comment:
The spawn() function has this code outside of any error handler:
pid, master_fd = fork()
if pid == CHILD:
os.execlp(argv[0], *argv)
If fork() succeeds, there will actually be a parent Python process and a child Python process. If exec() then fails, an exception will escape the spawn() function in the child process, while the parent process will carry on as if all is well. Maybe it would be worthwhile studying how the “subprocess” module handles exec() failure in the child process.
----------
nosy: +martin.panter
stage: -> needs patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17824>
_______________________________________
More information about the Python-bugs-list
mailing list