Skip to content

Process get_threads() and get_num_threads() occasionally fails with NoSuchProcess exception on Windows #180

Closed
@giampaolo

Description

From g.rodola on July 07, 2011 12:49:27

What steps will reproduce the problem?  
p = psutil.Process(os.getpid())
x = 0
while 1:
    x += 1
    p.get_threads()
    print x 

What is the expected output?  


What do you see instead?  
After a while  the script above will fail with a NoSuchProcess "process no 
longer exists" exception.
Problem is OpenThread() call in _psutil_mswindows.c which suddenly fails with 
ERROR_INVALID_PARAMETER which we treat as a synonym for "NoSuchProcess".
Still not sure what is the right thing to do in that case.

Original issue: http://code.google.com/p/psutil/issues/detail?id=180

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions