In python 2.6 there is no spawnl function?

I just noticed that my old codes written in python 2.5 now do not work. I am in python 2.6 bit.

>>> os.spawnl(os.P_NOWAIT,"setup.exe")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\python26\lib\os.py", line 612, in spawnl
    return spawnv(mode, file, args)
OSError: [Errno 22] Invalid argument
>>>

Any clue? or you have a working os.spawn * sample with the NOWAIT option.

Update:

Even I put the full path in os.spawnl (), its still an error.

+3
source share
5 answers
The rule

fits approximately to subprocess. But spawn * stuff is still present in 2.6 . In fact, you can see this in your error message. Your first argument seems valid. I would check the second arg, which is the path.

+5
source

I got this by adding the DUMMY parameter, finally a bit funky though

os.spawnl(os.P_NOWAIT,"Setup.exe")

os.spawnl(os.P_NOWAIT,"Setup.exe","")

os.spawnl(os.P_NOWAIT,"Setup.exe","DUMMY")

.

+5

, subprocess, os.spawn*. ( , ).

+3

os.spawnl() , os.spawnlp() PATH .

. ( , , ).

+2

Google , Python. , , , ?

In any case, in accordance with the MS documentation, this error value (EINVAL) should be returned only if the mode argument is not valid, which isn This is not the case.

+2
source

Source: https://habr.com/ru/post/1723595/


All Articles