Closed GoogleCodeExporter closed 9 years ago
You can wrap the call to get_process_info() in deproxy() and just raise the
exception
from there. That would be easier than having to write the exception into the C
code
for every platform like we had to do for NoSuchProcess exceptions.
Original comment by jlo...@gmail.com
on 23 Feb 2009 at 5:54
Committed as r154 which adds an InsufficientPermission error class in psutil.py
and a
"wrap_privileges" decorator around get_process_info() and kill() methods, which
translates system-dependent exceptions signaling insufficient permissions into
InsufficientPermission's psutil exception.
Open issues:
- Do we want an alternative name for InsufficientPermission (e.g.
InsufficientPermissionError, NoSuchPermission/Error, AccessDenied/Error)?
- More test cases would be needed. I've only added a test case for posix
platforms
based on os.getuid() > 0 to make sure that InsufficientPermission is raised
when a
limited user attempts to kill PID 1 (init), but there are currently no test
cases for
Windows.
Original comment by billiej...@gmail.com
on 24 Feb 2009 at 1:00
Original comment by billiej...@gmail.com
on 24 Feb 2009 at 5:25
Per conversation with Jay renamed InsufficientPermission in AccessDenied.
Original comment by billiej...@gmail.com
on 24 Feb 2009 at 10:14
Original comment by billiej...@gmail.com
on 24 Feb 2009 at 10:16
Is this one done now? I think we can close this out since it's implemented on
all
platforms?
Original comment by jlo...@gmail.com
on 25 Feb 2009 at 2:56
[deleted comment]
Yes, I can't think of any way to test this on Windows so we can just close this
one out.
Original comment by billiej...@gmail.com
on 25 Feb 2009 at 3:34
Original comment by billiej...@gmail.com
on 17 Mar 2009 at 3:31
[deleted comment]
Updated csets after the SVN -> Mercurial migration:
r154 == revision 3b9087cefb58
Original comment by g.rodola
on 2 Mar 2013 at 11:44
Original issue reported on code.google.com by
billiej...@gmail.com
on 23 Feb 2009 at 5:11