Open CitrusWire opened 5 hours ago
Note that the arguments passed are all arguments seen by the program, including argv[0].
The example in the docs at https://docs.python.org/3/library/os.html#os.spawnvpe shows this:
import os
os.spawnlp(os.P_WAIT, 'cp', 'cp', 'index.html', '/dev/null')
Note that 'cp'
is listed twice, first as the name of the executable to start and then as the value seen in argv[0]
of the spawned program.
I think it's a doc issue but I can't be entirely sure about it. spanwl has a signature (mode, path, ...) so it's correct to perhaps assume that 2 arguments is enough.
Bug report
Bug description:
Python 3.8 and 3.11.9
Probably related to: https://github.com/python/cpython/issues/52284 Seems to be the same as: https://github.com/python/cpython/issues/63130
A number of bugs:
1) - Doesn't work with no arguements.
2) If I try and make the arguement empty it also fails. This means that I am forced to send an arguement that may trigger an unknown behaviour in the spawned application.:
2) If any aspect of this is intended, then the documentation needs to be updated to explicitly say this. Currently it implies any arguments are optional. (Honestly, the docs for this are bad generally.)
CPython versions tested on:
3.11
Operating systems tested on:
Windows