This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients docs@python, eryksun, jwilk, paul.moore, steve.dower, techtonik, terry.reedy, tim.golden, zach.ware
Date 2021-03-21.13:04:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1616331858.19.0.513660806298.issue19124@roundup.psfhosted.org>
In-reply-to
Content
> On Windows, the new process is executed in the background but 
> can send output to a console if the original process was 
> started in a console.

C execv[e]() is a mess for console applications. The child process is competing for console input with an ancestor process in the console session, which is typically a CLI shell such as CMD or PowerShell. This is dysfunctional. It's worth either fixing or deprecating. It's not worth documenting since it's way off spec compared to exec() in POSIX systems. exec() is supposed to overlay the current process with a new image, not terminate the current process. That cannot be implemented in Windows, but we could do our best to emulate it. 

The implementation could leave the current Python process running in much the same way as a launcher functions, i.e. wait for the child process to exit and proxy its exit status, and set the child process in a kill-on-close job object.

It would be better at this point to use subprocess.Popen() to implement os.exec*, considering it can work concurrently with itself, without race conditions involving inheritable handles. nt.spawnv[e](), nt.waitpid(), and nt.system() could also be implemented with subprocess.
History
Date User Action Args
2021-03-21 13:04:18eryksunsetrecipients: + eryksun, terry.reedy, paul.moore, techtonik, tim.golden, jwilk, docs@python, zach.ware, steve.dower
2021-03-21 13:04:18eryksunsetmessageid: <1616331858.19.0.513660806298.issue19124@roundup.psfhosted.org>
2021-03-21 13:04:18eryksunlinkissue19124 messages
2021-03-21 13:04:16eryksuncreate