[pydev - Users] Error running script that starts a subprocess

View: New views
3 Messages — Rating Filter:   Alert me  

[pydev - Users] Error running script that starts a subprocess

by SourceForge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7466004
By: timblacktu

I'm trying to run a script that tries to run a program called omniidl.exe using
subprocess.call(), like so:

import subprocess
retcode = subprocess.call("omniidl", shell=True)

As soon as I get to Popen.__init__()-->_execute_child()-->CreateProcess() the
following error is printed:

'import site' failed; use -v for traceback
Traceback (innermost last):
  File "<string>", line 1, in ?
  File "c:\Python25\lib\os.py", line 39
    return [n for n in dir(module) if n[0] != '_']
                ^
SyntaxError: invalid syntax

The location of omniidl.exe is properly pointed to by my PATH env var and I
can successfully run this same command:
0. via the DOS command line: "omniidl"
1. via Python command line: "retcode = subprocess.call("omniidl", shell=True)"

The expected output is "omniidl: No files specified. Use 'omniidl -u' for
usage."

Any idea what might be going on here? I'm using Windows XP, Python 2.5.2, Eclipse
SDK Version: 3.3.2 Build id: M20080221-1800. Pydev version 1.3.22.

Thanks,
Tim

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=293649

------------------------------------------------------------------------------
_______________________________________________
Pydev-users mailing list
Pydev-users@...
https://lists.sourceforge.net/lists/listinfo/pydev-users

[pydev - Users] RE: Error running script that starts a subprocess

by SourceForge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7466437
By: fabioz

Have you checked if the process running has the path/pythonpath variables correct
through os.environ? (maybe you have more than one python installed and the wrong
one ends up available in the path?)

Cheers,

Fabio



______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=293649

------------------------------------------------------------------------------
_______________________________________________
Pydev-users mailing list
Pydev-users@...
https://lists.sourceforge.net/lists/listinfo/pydev-users

[pydev - Users] RE: Error running script that starts a subprocess

by SourceForge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7470096
By: timblacktu

I have verified that os.environ is correct in my script, before the call to
subprocess.call. But the process I'm invoking is a win32 executable, not python.

The process does, however, have python embedded in it, however. The executable
does some processing and then imports a customizable python module and calls
a function in it. But I'm calling omniidl with no parameters, which should just
immediately print out an error and not even invoke the python interpreter. That
is why I posted it on pydev instead of omniidl. It smells like an eclipse thing,
bc I can do all the same operations manually from the dos command line...

Any other ideas?

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=293649

------------------------------------------------------------------------------
_______________________________________________
Pydev-users mailing list
Pydev-users@...
https://lists.sourceforge.net/lists/listinfo/pydev-users