You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
>>> import psutil
>>> p = psutil.Process(3276)
>>> p.is_running()
True
>>> p.get_cpu_times()
(0.015600099999999999, 0.015600099999999999)
>>> p.get_memory_info()
(20480, 0)
>>> p.kill()
>>> p.is_running()
False
>>> p.get_cpu_times()
(0.015600099999999999, 0.015600099999999999)
>>> p.get_memory_info()
(20480, 0)
What is the expected output?
What do you see instead?
I'd expect NoSuchProcess to be raised after the process has been killed.
Please use labels and text to provide additional information.
The test suite containes the following tests which were disabled on Windows
because of this issue:
# XXX - these tests are supposed to work everywhere except
# Windows which keeps returning info for a dead process.
if not sys.platform.lower().startswith("win32"):
self.assertRaises(psutil.NoSuchProcess, p.get_cpu_times)
self.assertRaises(psutil.NoSuchProcess, p.get_cpu_percent)
self.assertRaises(psutil.NoSuchProcess, p.get_memory_info)
self.assertRaises(psutil.NoSuchProcess, p.get_memory_percent)
Fixed as r512 by having used GetExitProcess() to check whether the handle returned by
OpenProcess() is still alive.
I'm thinking that maybe we should use GetExitProcess() every time we use OpenProcess().
It is also possible that other functions suffer the same issue.
From billiej...@gmail.com on February 22, 2010 23:42:12
Original issue: http://code.google.com/p/psutil/issues/detail?id=76
The text was updated successfully, but these errors were encountered: