[issue6554] Do we have something like os.pid_exists()?

Jean-Paul Calderone report at bugs.python.org
Thu Jul 23 20:50:22 CEST 2009


Jean-Paul Calderone <exarkun at divmod.com> added the comment:

It might be better to pick a better (but probably platform-specific) API
for such a use-case.  os.kill has a problem with false positives (on
Linux it will tell you a process exists even when it doesn't).  Looking
in /proc/ or using a Windows API to enumerate all existing processes
might be better.  These have the advantage of giving you a bunch of PID
information all at once which you can then check against, rather than
repeatedly making syscalls.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6554>
_______________________________________


More information about the Python-bugs-list mailing list