Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_memory_percent() raises AccessDenied on Windows #42

Closed
giampaolo opened this issue May 23, 2014 · 3 comments
Closed

get_memory_percent() raises AccessDenied on Windows #42

giampaolo opened this issue May 23, 2014 · 3 comments

Comments

@giampaolo
Copy link
Owner

From billiej...@gmail.com on March 21, 2009 20:10:35

What steps will reproduce the problem?  
<snippet>
import psutil

n = 0
for p in psutil.process_iter():
    try:
        n += p.get_memory_percent()
    except:
        print p.pid
        print p.name
        raise
print n
</snippet>

raises:

D:\pyftpdlib\svn\psutil>foo.py
944
csrss.exe
Traceback (most recent call last):
  File "D:\pyftpdlib\svn\psutil\foo.py", line 10, in <module>
    n += p.get_memory_percent()
  File "D:\pyftpdlib\svn\psutil\psutil\_psutil.py", line 250, in
get_memory_perc
ent
    rss = _platform_impl.get_memory_info(self.pid)[0]
  File "psutil\_psmswindows.py", line 29, in wrapper
    raise AccessDenied
psutil.error.AccessDenied


csrss.exe is owned by the SYSTEM user, I'm running the script as Administrator.

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

@giampaolo
Copy link
Owner Author

From jlo...@gmail.com on March 23, 2009 14:34:13

Fixed, needed to set SE_DEBUG privilege first. I decided to just set this once in the
init of the module since it's needed all over the place for anything that reads data
for a process owned by another user.

Status: Fixed

@giampaolo
Copy link
Owner Author

From jlo...@gmail.com on March 23, 2009 14:34:28

Fixed as r304

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 03:47:53

Updated csets after the SVN -> Mercurial migration: r304 == revision ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant