process.py problems

Trent Mick trentm at ActiveState.com
Tue Jul 8 12:40:57 EDT 2003


Justin,

Can you try turning logging on in process.py to perhaps get a better
picture of what it is trying to do. Look for the "internal logging"
section. There should be some "if 0"s that you can turn to "if 1"s for
debugging. (Or vice versa -- my process.py version is a little bit
different than the public one.)

My guess: process.py, in some cases, will try to run command via the
local shell (i.e. cmd.exe or command.com on Windows). This is necessary
for some commands like "dir" which are not executables themselves but
just a part of the shell. However, process.py is not as clean as it
should be on when it does and when it does not use the shell. Perhaps
process.py is not using the shell when it should here.

... note, there may also be a problem with respect to which.py and
process.py version mismatch. which.py 1.x changed its API from which.py
0.x and process.py may not be dealing with that correctly. I may need to
put up a new process.py to get that right. What is the output of:
    which --version
or:
    >>> import which
    >>> which._version_

Cheers,
Trent

[Justin Johnson wrote]
> Hello,
> 
> I was wondering if anyone has seen this behavior before for the
> process.py
> module available at http://starship.python.net/crew/tmick/.  I've been
> using it quite well on windows 2000 servers, but when I try to use it on
> a window nt 4.0 box I get the results posted below.  I have both
> process.py and which.py installed.
> 
> Any help you can provide is greatly appreciated.
> 
> >>> import process
> >>> p = process.ProcessOpen("dir")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "process.py", line 1108, in __init__
>     self._startOnWindows()
>   File "process.py", line 1279, in _startOnWindows
>     cmd = _fixupCommand(cmd, self._env)
>   File "process.py", line 506, in _fixupCommand
>     cmd = _whichFirstArg(cmd, env)
>   File "process.py", line 315, in _whichFirstArg
>     candidates = list(which.which(first))
>   File "which.py", line 251, in which
>     raise WhichError("Could not find '%s' on the path." % command)
> which.WhichError: Could not find 'dir' on the path.
> >>> p = process.ProcessOpen("dir.exe")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "process.py", line 1108, in __init__
>     self._startOnWindows()
>   File "process.py", line 1279, in _startOnWindows
>     cmd = _fixupCommand(cmd, self._env)
>   File "process.py", line 506, in _fixupCommand
>     cmd = _whichFirstArg(cmd, env)
>   File "process.py", line 315, in _whichFirstArg
>     candidates = list(which.which(first))
>   File "which.py", line 251, in which
>     raise WhichError("Could not find '%s' on the path." % command)
> which.WhichError: Could not find 'dir.exe' on the path.
> >>> p = process.ProcessOpen("cmd")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "process.py", line 1108, in __init__
>     self._startOnWindows()
>   File "process.py", line 1295, in _startOnWindows
>     raise ProcessError(msg=ex.args[2], errno=ex.args[0])
> process.ProcessError: The system cannot find the file specified.
> >>> 
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list

-- 
Trent Mick
TrentM at ActiveState.com





More information about the Python-list mailing list