Skip to content

Commit

Permalink
Merge branch 'master' of github.com:giampaolo/psutil
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Sep 15, 2014
2 parents e14348b + 2400779 commit e1d1fd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 1 addition & 7 deletions psutil/_psutil_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,13 +573,7 @@ psutil_proc_exe(PyObject *self, PyObject *args) {
}
if (GetProcessImageFileNameW(hProcess, &exe, MAX_PATH) == 0) {
CloseHandle(hProcess);
if (GetLastError() == ERROR_INVALID_PARAMETER) {
// see https://github.com/giampaolo/psutil/issues/414
AccessDenied();
}
else {
PyErr_SetFromWindowsErr(0);
}
PyErr_SetFromWindowsErr(0);
return NULL;
}
CloseHandle(hProcess);
Expand Down
5 changes: 5 additions & 0 deletions psutil/_pswindows.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ def exe(self):
# Note: os.path.exists(path) may return False even if the file
# is there, see:
# http://stackoverflow.com/questions/3112546/os-path-exists-lies

# see https://github.com/giampaolo/psutil/issues/414
# see https://github.com/giampaolo/psutil/issues/528
if self.pid in (0, 4):
raise AccessDenied(self.pid, self._name)
return _convert_raw_path(cext.proc_exe(self.pid))

@wrap_exceptions
Expand Down

0 comments on commit e1d1fd7

Please sign in to comment.