summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-01-06 14:08:03 -0800
committerGiampaolo Rodola <g.rodola@gmail.com>2020-01-06 14:08:03 -0800
commit56525b5299d3fd2830cf479df52cb5f527aeed66 (patch)
tree94c3d4af63db40d0e8c1c60fd0a693a4ad74df36
parent5aedd552404c5c19cd0412c02f3292d8b952e8d4 (diff)
downloadpsutil-56525b5299d3fd2830cf479df52cb5f527aeed66.tar.gz
fix #1656: [Windows] Process.memory_full_info() raises AccessDenied even for the current user and os.getpid()
-rw-r--r--HISTORY.rst2
-rw-r--r--psutil/_psutil_windows.c2
-rw-r--r--psutil/_pswindows.py2
-rw-r--r--psutil/tests/__init__.py2
4 files changed, 5 insertions, 3 deletions
diff --git a/HISTORY.rst b/HISTORY.rst
index d112ccc2..a64ad57a 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -18,6 +18,8 @@ XXXX-XX-XX
- 1642_: [SunOS] querying basic info for PID 0 results in FileNotFoundError.
- 1646_: [FreeBSD] many Process methods may cause a segfault on FreeBSD 12.0
due to a backward incompatible change in a C type introduced in 12.0.
+- 1656_: [Windows] Process.memory_full_info() raises AccessDenied even for the
+ current user and os.getpid().
5.6.7
=====
diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c
index 0e780d9b..228566ac 100644
--- a/psutil/_psutil_windows.c
+++ b/psutil/_psutil_windows.c
@@ -655,7 +655,7 @@ psutil_proc_memory_uss(PyObject *self, PyObject *args) {
if (! PyArg_ParseTuple(args, "l", &pid))
return NULL;
- hProcess = psutil_handle_from_pid(pid, PROCESS_QUERY_LIMITED_INFORMATION);
+ hProcess = psutil_handle_from_pid(pid, PROCESS_QUERY_INFORMATION);
if (hProcess == NULL)
return NULL;
diff --git a/psutil/_pswindows.py b/psutil/_pswindows.py
index 772c38c1..f5c81c6d 100644
--- a/psutil/_pswindows.py
+++ b/psutil/_pswindows.py
@@ -860,7 +860,7 @@ class Process(object):
# py >= 2.7
elif sig in (getattr(signal, "CTRL_C_EVENT", object()),
getattr(signal, "CTRL_BREAK_EVENT", object())):
- os.kill(self.pid, sig)(sig)
+ os.kill(self.pid, sig)
else:
raise ValueError(
"only SIGTERM, CTRL_C_EVENT and CTRL_BREAK_EVENT signals "
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py
index 767524af..a4dc499a 100644
--- a/psutil/tests/__init__.py
+++ b/psutil/tests/__init__.py
@@ -127,7 +127,7 @@ NO_RETRIES = 10
# bytes tolerance for system-wide memory related tests
MEMORY_TOLERANCE = 500 * 1024 # 500KB
# the timeout used in functions which have to wait
-GLOBAL_TIMEOUT = 3 if TRAVIS or APPVEYOR else 0.5
+GLOBAL_TIMEOUT = 3
# be more tolerant if we're on travis / appveyor in order to avoid
# false positives
if TRAVIS or APPVEYOR: