[Python-bugs-list] [ python-Bugs-537582 ] incorrect pid returned from os.spawn
noreply@sourceforge.net
noreply@sourceforge.net
Sun, 31 Mar 2002 19:17:24 -0800
Bugs item #537582, was opened at 2002-03-31 21:42
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=537582&group_id=5470
>Category: Documentation
>Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: alastair nicol (ajnicol)
>Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: incorrect pid returned from os.spawn
Initial Comment:
The pid returned from the os.spawnv and os.spawnl method
is incorrect.
This can be easily demostrated by swawning a python
prog containing "time.sleep(100000)". The pid returned
by spawn isnt the same as the pid as reported by task
manager.
I have only tried this with os.spawnl and os.spawnv
For example:-
spawnv reported pid=92
windows reported pid=1484
Software:
Python 2.2 (downloaded .exe from python.org)
Windows 2000 Pro
Al
----------------------------------------------------------------------
>Comment By: Tim Peters (tim_one)
Date: 2002-03-31 22:17
Message:
Logged In: YES
user_id=31435
There's nothing wrong with what the spawn functions return
on Windows -- indeed, they return exactly what the
Microsoft spawn functions return.
The problem is that, on Windows, processes have
both "process handles" and "process ids", they're both
integers, and Microsoft's own docs confuse the two
routinely. "process handle" is the better name for what
spawn returns on Windows. You wouldn't want it to return
the process id: almost all Win32 API functions require a
process handle.
Reassigned to Fred and changed category to Docs: Fred, can
you fiddle things to explain that the spawn family really
returns what Windows calls a "process handle"? Ditto that
os.waitpid() in 2.3 on Windows takes a process handle as
argument?
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=537582&group_id=5470