Author vstinner
Recipients pablogsal, serhiy.storchaka, vstinner
Date 2019-01-07.00:46:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1546821968.26.0.975322975658.issue35674@roundup.psfhosted.org>
In-reply-to
Content
bpo-20104 exposed os.posix_spawn(), but not os.posix_spawnp().

os.posix_spawnp() would be useful to support executable with no directory. See bpo-35537 "use os.posix_spawn in subprocess".

I'm not sure what is the best API:

* Add os.posix_spawnp()? duplicate the documentation and some parts of the C code (but share most of the C code)
* Add a new optional parameter to os.posix_spawn()? Ideas of names: 'use_path' or 'search_executable'. Internally, the glibc uses SPAWN_XFLAGS_USE_PATH flag to distinguish posix_spawn() and posix_spawnp().

execvp() uses the PATH environment variable, or use confstr(_CS_PATH) if PATH is not set. I guess that posix_spawnp() also uses confstr(_CS_PATH) if PATH is not set.

Currently, my favorite option is to add a new optional 'use_path' parameter to the existing os.posix_spawn() function.
History
Date User Action Args
2019-01-07 00:46:11vstinnersetrecipients: + vstinner, serhiy.storchaka, pablogsal
2019-01-07 00:46:08vstinnersetmessageid: <1546821968.26.0.975322975658.issue35674@roundup.psfhosted.org>
2019-01-07 00:46:08vstinnerlinkissue35674 messages
2019-01-07 00:46:08vstinnercreate