os.spawnl error

S

Salvatore

Hello,

Does someone already had ths problem ?
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python24\lib\os.py", line 565, in spawnl
return spawnv(mode, file, args)
OSError: [Errno 22] Invalid argument

Regards

Salvatore
 
F

Fredrik Lundh

Salvatore said:
Does someone already had ths problem ?
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python24\lib\os.py", line 565, in spawnl
return spawnv(mode, file, args)
OSError: [Errno 22] Invalid argument

that string doesn't contain what you think:
c:\windows
otepad.exe

you can use "raw" string literals to get around this:

more here:

http://docs.python.org/tut/node5.html#SECTION005120000000000000000

</F>
 
L

Larry Bates

The backslashes in your path are being interpreted
as escape characters (e.g. \n is a newline).

Try instead:

os.spawnl(os.P_NOWAIT,r'c:\windows\notepad.exe')

or

os.spawnl(os.P_NOWAIT,'c:\\windows\\notepad.exe')

-Larry Bates

Hello,

Does someone already had ths problem ?


Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python24\lib\os.py", line 565, in spawnl
return spawnv(mode, file, args)
OSError: [Errno 22] Invalid argument

Regards

Salvatore
 
U

utabintarbo

I have found the judicious use of os.path.normpath(path) to be quite
useful as well.

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top