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_open_files() raises private Exception 'psutil._error.AccessDenied' #479

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

Comments

@giampaolo
Copy link
Owner

From l...@hupfeldtit.dk on February 16, 2014 17:05:11

Reproduce -

for proc in psutil.process_iter():
    proc.get_open_files()

Result -
----
Traceback (most recent call last):
  File "/usr/lib/python3.3/site-packages/psutil/_pslinux.py", line 463, in wrapper
    return fun(self, *args, **kwargs)
  File "/usr/lib/python3.3/site-packages/psutil/_pslinux.py", line 908, in 
get_open_files
    files = os.listdir("/proc/%s/fd" % self.pid)
PermissionError: [Errno 13] Permission denied: '/proc/1/fd'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./singleton_script.py", line 6, in <module>
    proc.get_open_files()
  File "/usr/lib/python3.3/site-packages/psutil/__init__.py", line 808, in 
get_open_files
    return self._platform_impl.get_open_files()
  File "/usr/lib/python3.3/site-packages/psutil/_pslinux.py", line 472, in wrapper
    raise AccessDenied(self.pid, self._process_name)
psutil._error.AccessDenied: (pid=1)
----
Expected a non private error (i.e. no '_error')

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

@giampaolo
Copy link
Owner Author

From g.rodola on February 16, 2014 09:08:28

Agreed. I've been unhappy with this for a while.
2.0.0 is the right chance to change this.

@giampaolo
Copy link
Owner Author

From g.rodola on February 16, 2014 09:30:34

I killed long deprecated errors.py and _errors.py modules in revision 
c001b5f9a258 .
Exception classes now live in "psutil" namespace only.
Closing and thanks.

Status: FixedInHG
Labels: Milestone-2.0.0

@giampaolo
Copy link
Owner Author

From g.rodola on March 10, 2014 04:36:50

Closing out as fixed as 2.0.0 version is finally out.

Status: Fixed

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