process.py problems

Justin Johnson justinjohnson at fastmail.fm
Tue Jul 8 23:08:29 CEST 2003


Thanks for the reply!

which 1.0.2

Here's the log output with the dir command
-----------------------
process.res: info:[18392288] ProcessOpen._start(): create child stdin:
<_FileWra
pper: file:None fd:3 os_handle:<PyHANDLE object at 0x0118C694>>
process.res: info:[18392288] ProcessOpen._start(): create child stdout:
<_FileWr
apper: file:None fd:4 os_handle:<PyHANDLE object at 0x0118C674>>
process.res: info:[18392288] ProcessOpen._start(): create child stderr:
<_FileWr
apper: file:None fd:5 os_handle:<PyHANDLE object at 0x0118C654>>
process.res: info:[18392288] ProcessOpen.__del__()
process: info:[18392288] ProcessOpen.close()
process: info:[18392288] ProcessOpen: closing stdin (<_FileWrapper:
file:None fd
:3 os_handle:<PyHANDLE object at 0x0118C694>>).
process: debug:[18400496] _FileWrapper.close()
process: debug:[18400496] _FileWrapper.close: close handle
process: debug:[18400496] _FileWrapper.close: closing handle raised
process: debug:[18400496] _FileWrapper.close: done closing handle
process: info:[18392288] ProcessOpen: closing stdout (<_FileWrapper:
file:None f
d:4 os_handle:<PyHANDLE object at 0x0118C674>>).
process: debug:[18400720] _FileWrapper.close()
process: debug:[18400720] _FileWrapper.close: close handle
process: debug:[18400720] _FileWrapper.close: closing handle raised
process: debug:[18400720] _FileWrapper.close: done closing handle
process: info:[18392288] ProcessOpen: closing stderr (<_FileWrapper:
file:None f
d:5 os_handle:<PyHANDLE object at 0x0118C654>>).
process: debug:[18403024] _FileWrapper.close()
process: debug:[18403024] _FileWrapper.close: close handle
process: debug:[18403024] _FileWrapper.close: closing handle raised
process: debug:[18403024] _FileWrapper.close: done closing handle
process: debug:[18400720] _FileWrapper.close()
process: debug:[18400496] _FileWrapper.close()
process: debug:[18403024] _FileWrapper.close()
----------------

I also get the following results running commands that are in my path...
------------------
g`"apper: file:None fd:5 os_handle:<PyHANDLE object at 0x011D30A4>>
process: debug:_SaferCreateProcess(appName=None,
                    cmd='C lsview -s',
                    env=None,
                    cwd=None)
    os.getcwd(): 'E:\\ccase\\python\\uhg\\uht'

process.res: info:[18680944] ProcessOpen.__del__()
process: info:[18680944] ProcessOpen.close()
process: info:[18680944] ProcessOpen: closing stdin (<_FileWrapper:
file:None fd
:3 os_handle:<PyHANDLE object at 0x011D4744>>).
process: debug:[18696880] _FileWrapper.close()
process: debug:[18696880] _FileWrapper.close: close handle
process: debug:[18696880] _FileWrapper.close: closing handle raised
process: debug:[18696880] _FileWrapper.close: done closing handle
process: info:[18680944] ProcessOpen: closing stdout (<_FileWrapper:
file:None f
d:4 os_handle:<PyHANDLE object at 0x011D47C4>>).
process: debug:[18696832] _FileWrapper.close()
process: debug:[18696832] _FileWrapper.close: close handle
process: debug:[18696832] _FileWrapper.close: closing handle raised
process: debug:[18696832] _FileWrapper.close: done closing handle
process: info:[18680944] ProcessOpen: closing stderr (<_FileWrapper:
file:None f
d:5 os_handle:<PyHANDLE object at 0x011D30A4>>).
process: debug:[18699984] _FileWrapper.close()
process: debug:[18699984] _FileWrapper.close: close handle
process: debug:[18699984] _FileWrapper.close: closing handle raised
process: debug:[18699984] _FileWrapper.close: done closing handle
process: debug:[18696832] _FileWrapper.close()
process: debug:[18696880] _FileWrapper.close()
process: debug:[18699984] _FileWrapper.close()
---------


On Tue, 8 Jul 2003 09:40:57 -0700, "Trent Mick" <trentm at ActiveState.com>
said:
> 
> 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