You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Probably related to: #52284
Seems to be the same as: #63130
A number of bugs:
Doesn't work with no arguements.
>>> os.spawnl(os.P_NOWAIT, "c:\path_to_some_program\app.exe")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<frozen os>", line 930, in spawnl
ValueError: spawnv() arg 2 cannot be empty
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.:
>>> os.spawnl(os.P_NOWAIT, "c:\path_to_some_program\app.exe", '')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<frozen os>", line 930, in spawnl
ValueError: spawnv() arg 2 first element cannot be empty
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.)
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.
A user should not need to look at a different method's documentation to understand how to use this specific method.
What if I don't want any arguments passed to the spawned program? To me that seems like it could become a security issue because you're sending spurious arguements to probably a third-party program, and you don't know how that program will react to them.
spanwl has a signature (mode, path, ...) so it's correct to perhaps assume that 2 arguments is enough.
This is certainly one of the things that confused me.
Activity
ronaldoussoren commentedon Nov 17, 2024
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:
Note that
'cp'is listed twice, first as the name of the executable to start and then as the value seen inargv[0]of the spawned program.picnixz commentedon Nov 17, 2024
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.
CitrusWire commentedon Nov 19, 2024
Several things:
This is certainly one of the things that confused me.