New submission from STINNER Victor <vstin...@redhat.com>:

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.

----------
components: Interpreter Core
messages: 333128
nosy: pablogsal, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Expose os.posix_spawnp()
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35674>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to