Marc-Andre Lemburg <m...@egenix.com> added the comment:
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. ---------- nosy: +lemburg _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42738> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com