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 lemburg
Recipients eryksun, gregory.p.smith, izbyshev, lemburg, richardxia, vstinner
Date 2021-10-27.08:25:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1635323128.62.0.934649238851.issue42738@roundup.psfhosted.org>
In-reply-to
Content
Gregory P. Smith wrote:
> A higher level "best practices for launching child processes module" with APIs reflecting explicit intents (performance vs security vs simplicity) rather than requiring users to understand subprocess platform specific details may be a good idea at this point (on PyPI I assume).

Interesting that you say that. subprocess was originally written with exactly this idea in mind - to create a module which deals with all the platform details, so that the user doesn't have to know about them: https://www.python.org/dev/peps/pep-0324/#motivation

On the topic itself: I believe Python should come with safe and usable defaults, but provide ways to enable alternative approaches which have more performance if the user so decides (by e.g. passing in a parameter). In such cases, the user then becomes responsible for understanding the implications.

Since there already is a parameter, expert users can already gain more performance by using it and then explicitly only closing FDs the users knows can/should be closed in the new process.

Perhaps there's a middle ground: have subprocess only loop over the first 64k FDs per default and not all possible ones.
History
Date User Action Args
2021-10-27 08:25:28lemburgsetrecipients: + lemburg, gregory.p.smith, vstinner, eryksun, izbyshev, richardxia
2021-10-27 08:25:28lemburgsetmessageid: <1635323128.62.0.934649238851.issue42738@roundup.psfhosted.org>
2021-10-27 08:25:28lemburglinkissue42738 messages
2021-10-27 08:25:28lemburgcreate