Hello community, here is the log from the commit of package python-psutil for openSUSE:Factory checked in at 2019-03-29 20:36:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-psutil (Old) and /work/SRC/openSUSE:Factory/.python-psutil.new.25356 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-psutil" Fri Mar 29 20:36:27 2019 rev:49 rq:687163 version:5.6.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-psutil/python-psutil.changes 2019-03-12 09:46:01.155626513 +0100 +++ /work/SRC/openSUSE:Factory/.python-psutil.new.25356/python-psutil.changes 2019-03-29 20:36:28.702580726 +0100 @@ -1,0 +2,15 @@ +Mon Mar 18 02:29:21 UTC 2019 - John Vandenberg <[email protected]> + +- Active test suite, using skip-test-missing-warnings.patch to + explicitly skip 2 tests regarding warnings, skip-flaky-i586.patch + to skip a flaky i586 test, and setting TRAVIS to skip tests which + upstream doesnt run in their CI +- Add upstream pr_1364.patch to fix reading /sys/blocks on Linux 4.18+ +- Remove tests from installed package +- Use URL https://github.com/giampaolo/psutil +- Use LANG=en_US.UTF-8 in %check to avoid failure in test_pmap +- update to version 5.6.1 + * No changes effecting Linux + * Many checks added to tests to skip tests for missing features + +------------------------------------------------------------------- Old: ---- psutil-5.6.0.tar.gz New: ---- pr_1364.patch psutil-5.6.1.tar.gz skip-flaky-i586.patch skip-test-missing-warnings.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-psutil.spec ++++++ --- /var/tmp/diff_new_pack.iNPsY3/_old 2019-03-29 20:36:29.654582099 +0100 +++ /var/tmp/diff_new_pack.iNPsY3/_new 2019-03-29 20:36:29.658582105 +0100 @@ -16,27 +16,35 @@ # +%ifarch x86_64 %{ix86} +%bcond_without test +%else +%bcond_with test +%endif %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-psutil -Version: 5.6.0 +Version: 5.6.1 Release: 0 Summary: A process utilities module for Python License: BSD-3-Clause Group: Development/Languages/Python -URL: https://pypi.python.org/pypi/psutil/ +URL: https://github.com/giampaolo/psutil Source: https://files.pythonhosted.org/packages/source/p/psutil/psutil-%{version}.tar.gz +Patch0: pr_1364.patch +Patch1: skip-test-missing-warnings.patch +Patch2: skip-flaky-i586.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: net-tools Requires: procps -# SECTION test requirements +%if %{with test} BuildRequires: net-tools BuildRequires: procps BuildRequires: python-ipaddress BuildRequires: python-mock -# /SECTION +%endif %ifpython2 Requires: python-ipaddress %endif @@ -47,6 +55,10 @@ %prep %setup -q -n psutil-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + # Remove shebangs sed -i "1s/#!.*//" psutil/{__init__.py,_compat.py,_psbsd.py,_pslinux.py,_psosx.py,_psposix.py,_pssunos.py,_pswindows.py} @@ -60,14 +72,26 @@ cp -r scripts %{buildroot}%{_docdir}/%{$python_prefix}-psutil/ find %{buildroot}%{_docdir}/%{$python_prefix}-psutil/scripts/ -type f -name "*.py" -exec sed -i "s|#!%{_bindir}/env python|#!%__$python|" {} \; find %{buildroot}%{$python_sitearch}/psutil/tests/ -type f -name "*.py" -exec sed -i "s|#!%{_bindir}/env python|#!%__$python|" {} \; -chmod a+x %{buildroot}%{$python_sitearch}/psutil/tests/*.py -chmod a-x %{buildroot}%{$python_sitearch}/psutil/tests/__init__.py -$python -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/psutil/tests/ -$python -O -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/psutil/tests/ +rm -r %{buildroot}%{$python_sitearch}/psutil/tests/ %fdupes %{buildroot}%{_docdir}/%{$python_prefix}-psutil/ %fdupes %{buildroot}%{$python_sitearch} } +%if %{with test} +%check +export LANG=en_US.UTF-8 +export PSUTIL_TESTING=1 +export TRAVIS=1 + +# Note test_fetch_all is a bit flaky, occasionally failing +%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch} +cp -r scripts %{buildroot}%{$python_sitearch}/ +cp -r psutil/tests %{buildroot}%{$python_sitearch}/psutil +$python -W default %{buildroot}%{$python_sitearch}/psutil/tests/__main__.py +rm -r %{buildroot}%{$python_sitearch}/scripts %{buildroot}%{$python_sitearch}/psutil/tests +} +%endif + %files %{python_files} %license LICENSE %doc CREDITS HISTORY.rst README.rst ++++++ pr_1364.patch ++++++ >From 6688d5fca0f5d19ff7741b2d1585882c4663541b Mon Sep 17 00:00:00 2001 From: Jelle van der Waa <[email protected]> Date: Sun, 18 Nov 2018 19:55:08 +0100 Subject: [PATCH] [Linux] read_sysfs() fails on Linux 4.18+ Linux kernel 4.18+ added 4 fields to /sys/block/$dev/stat, ignore them and parse the rest as usual. --- psutil/_pslinux.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index b775d39ae..12f17e861 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -1099,8 +1099,13 @@ def read_sysfs(): with open_text(os.path.join(root, 'stat')) as f: fields = f.read().strip().split() name = os.path.basename(root) - (reads, reads_merged, rbytes, rtime, writes, writes_merged, - wbytes, wtime, _, busy_time, _) = map(int, fields) + if len(fields) == 11: + (reads, reads_merged, rbytes, rtime, writes, writes_merged, + wbytes, wtime, _, busy_time, _) = map(int, fields) + else: # Linux 4.18+ adds for fields for discard + (reads, reads_merged, rbytes, rtime, writes, writes_merged, + wbytes, wtime, _, busy_time, _, _, _, _, _) = map(int, + fields) yield (name, reads, writes, rbytes, wbytes, rtime, wtime, reads_merged, writes_merged, busy_time) ++++++ psutil-5.6.0.tar.gz -> psutil-5.6.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/CREDITS new/psutil-5.6.1/CREDITS --- old/psutil-5.6.0/CREDITS 2019-02-26 22:31:44.000000000 +0100 +++ new/psutil-5.6.1/CREDITS 2019-03-05 13:35:44.000000000 +0100 @@ -56,7 +56,8 @@ N: Arnon Yaari (wiggin15) W: https://github.com/wiggin15 D: AIX implementation, expert on multiple fronts -I: 517, 607, 610, 1131, 1123, 1130, 1154, 1164, 1174, 1177, 1210, 1214, 1408 +I: 517, 607, 610, 1131, 1123, 1130, 1154, 1164, 1174, 1177, 1210, 1214, 1408, + 1329. N: Alex Manuskin W: https://github.com/amanusk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/HISTORY.rst new/psutil-5.6.1/HISTORY.rst --- old/psutil-5.6.0/HISTORY.rst 2019-03-05 12:32:46.000000000 +0100 +++ new/psutil-5.6.1/HISTORY.rst 2019-03-11 15:27:41.000000000 +0100 @@ -1,5 +1,19 @@ *Bug tracker at https://github.com/giampaolo/psutil/issues* + +5.6.1 +===== + +2019-03-11 + +**Bug fixes** + +- 1329_: [AIX] psutil doesn't compile on AIX 6.1. (patch by Arnon Yaari) +- 1448_: [Windows] crash on import due to rtlIpv6AddressToStringA not available + on Wine. +- 1451_: [Windows] Process.memory_full_info() segfaults. NtQueryVirtualMemory + is now used instead of QueryWorkingSet to calculate USS memory. + 5.6.0 ===== @@ -17,6 +31,8 @@ call) significantly speeding up different functions and methods. - 1426_: [Windows] PAGESIZE and number of processors is now calculated on startup. +- 1428_: in case of error, the traceback message now shows the underlying C + function called which failed. - 1433_: new Process.parents() method. (idea by Ghislain Le Meur) - 1437_: pids() are returned in sorted order. - 1442_: python3 is now the default interpreter used by Makefile. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/INSTALL.rst new/psutil-5.6.1/INSTALL.rst --- old/psutil-5.6.0/INSTALL.rst 2019-03-05 12:31:18.000000000 +0100 +++ new/psutil-5.6.1/INSTALL.rst 2019-03-06 17:18:02.000000000 +0100 @@ -87,7 +87,6 @@ pkg install python3 gcc python -m pip3 install psutil - OpenBSD ======= @@ -97,7 +96,6 @@ pkg_add -v python3 gcc python3 -m pip install psutil - NetBSD ====== @@ -108,7 +106,6 @@ pkgin install python3 gcc python3 -m pip install psutil - Solaris ======= @@ -121,7 +118,6 @@ pkg install gcc python3 -m pip install psutil - Install from sources ==================== @@ -131,6 +127,12 @@ cd psutil python3 setup.py install +Testing installation +==================== + +:: + + python3 -m psutil.tests Dev Guide ========= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/PKG-INFO new/psutil-5.6.1/PKG-INFO --- old/psutil-5.6.0/PKG-INFO 2019-03-05 13:00:57.000000000 +0100 +++ new/psutil-5.6.1/PKG-INFO 2019-03-11 18:24:46.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: psutil -Version: 5.6.0 +Version: 5.6.1 Summary: Cross-platform lib for process and system monitoring in Python. Home-page: https://github.com/giampaolo/psutil Author: Giampaolo Rodola @@ -73,7 +73,7 @@ - **Sun Solaris** - **AIX** - ...both **32-bit** and **64-bit** architectures. Supported Python versions are **2.6**, **2.7** and 3.4+**. `PyPy <http://pypy.org/>`__ is also known to work. + ...both **32-bit** and **64-bit** architectures. Supported Python versions are **2.6**, **2.7** and **3.4+**. `PyPy <http://pypy.org/>`__ is also known to work. Author diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/README.rst new/psutil-5.6.1/README.rst --- old/psutil-5.6.0/README.rst 2019-03-01 03:06:14.000000000 +0100 +++ new/psutil-5.6.1/README.rst 2019-03-11 12:16:42.000000000 +0100 @@ -65,7 +65,7 @@ - **Sun Solaris** - **AIX** -...both **32-bit** and **64-bit** architectures. Supported Python versions are **2.6**, **2.7** and 3.4+**. `PyPy <http://pypy.org/>`__ is also known to work. +...both **32-bit** and **64-bit** architectures. Supported Python versions are **2.6**, **2.7** and **3.4+**. `PyPy <http://pypy.org/>`__ is also known to work. Author diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/docs/DEVGUIDE.rst new/psutil-5.6.1/docs/DEVGUIDE.rst --- old/psutil-5.6.0/docs/DEVGUIDE.rst 2019-03-02 21:46:28.000000000 +0100 +++ new/psutil-5.6.1/docs/DEVGUIDE.rst 2019-03-05 13:05:59.000000000 +0100 @@ -46,7 +46,7 @@ .. code-block:: bash make install # install - make setup-dev-env # install useful dev libs (fkale8, unittest2, etc.) + make setup-dev-env # install useful dev libs (flake8, unittest2, etc.) make test # run unit tests make test-memleaks # run memory leak tests make test-coverage # run test coverage diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/docs/index.rst new/psutil-5.6.1/docs/index.rst --- old/psutil-5.6.0/docs/index.rst 2019-03-05 12:32:05.000000000 +0100 +++ new/psutil-5.6.1/docs/index.rst 2019-03-11 15:27:31.000000000 +0100 @@ -37,7 +37,7 @@ - **Sun Solaris** - **AIX** -...both **32-bit** and **64-bit** architectures. Supported Python versions are **2.6**, **2.7** and 3.4+**. `PyPy <http://pypy.org/>`__ is also known to work. +...both **32-bit** and **64-bit** architectures. Supported Python versions are **2.6**, **2.7** and **3.4+**. `PyPy <http://pypy.org/>`__ is also known to work. The psutil documentation you're reading is distributed as a single HTML page. @@ -2630,14 +2630,18 @@ Timeline ======== +- 2019-03-11: + `5.6.1 <https://pypi.org/project/psutil/5.6.1/#files>`__ - + `what's new <https://github.com/giampaolo/psutil/blob/master/HISTORY.rst#561>`__ - + `diff <https://github.com/giampaolo/psutil/compare/release-5.6.0...release-5.6.1#files_bucket>`__ - 2019-03-05: `5.6.0 <https://pypi.org/project/psutil/5.6.0/#files>`__ - `what's new <https://github.com/giampaolo/psutil/blob/master/HISTORY.rst#560>`__ - - `diff <https://github.com/giampaolo/psutil/compare/release-5.5.1...release-5.6.0#files_bucket>` + `diff <https://github.com/giampaolo/psutil/compare/release-5.5.1...release-5.6.0#files_bucket>`__ - 2019-02-15: `5.5.1 <https://pypi.org/project/psutil/5.5.1/#files>`__ - `what's new <https://github.com/giampaolo/psutil/blob/master/HISTORY.rst#551>`__ - - `diff <https://github.com/giampaolo/psutil/compare/release-5.5.0...release-5.5.1#files_bucket>` + `diff <https://github.com/giampaolo/psutil/compare/release-5.5.0...release-5.5.1#files_bucket>`__ - 2019-01-23: `5.5.0 <https://pypi.org/project/psutil/5.5.0/#files>`__ - `what's new <https://github.com/giampaolo/psutil/blob/master/HISTORY.rst#550>`__ - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/__init__.py new/psutil-5.6.1/psutil/__init__.py --- old/psutil-5.6.0/psutil/__init__.py 2019-03-03 22:33:10.000000000 +0100 +++ new/psutil-5.6.1/psutil/__init__.py 2019-03-11 15:26:28.000000000 +0100 @@ -217,7 +217,7 @@ __all__.extend(_psplatform.__extra__all__) __author__ = "Giampaolo Rodola'" -__version__ = "5.6.0" +__version__ = "5.6.1" version_info = tuple([int(num) for num in __version__.split('.')]) _timer = getattr(time, 'monotonic', time.time) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/_psaix.py new/psutil-5.6.1/psutil/_psaix.py --- old/psutil-5.6.0/psutil/_psaix.py 2019-03-03 22:33:21.000000000 +0100 +++ new/psutil-5.6.1/psutil/_psaix.py 2019-03-05 13:34:36.000000000 +0100 @@ -39,6 +39,8 @@ HAS_THREADS = hasattr(cext, "proc_threads") +HAS_NET_IO_COUNTERS = hasattr(cext, "net_io_counters") +HAS_PROC_IO_COUNTERS = hasattr(cext, "proc_io_counters") PAGE_SIZE = os.sysconf('SC_PAGE_SIZE') AF_LINK = cext_posix.AF_LINK @@ -211,7 +213,9 @@ net_if_addrs = cext_posix.net_if_addrs -net_io_counters = cext.net_io_counters + +if HAS_NET_IO_COUNTERS: + net_io_counters = cext.net_io_counters def net_connections(kind, _pid=-1): @@ -563,14 +567,15 @@ def wait(self, timeout=None): return _psposix.wait_pid(self.pid, timeout, self._name) - @wrap_exceptions - def io_counters(self): - try: - rc, wc, rb, wb = cext.proc_io_counters(self.pid) - except OSError: - # if process is terminated, proc_io_counters returns OSError - # instead of NSP - if not pid_exists(self.pid): - raise NoSuchProcess(self.pid, self._name) - raise - return _common.pio(rc, wc, rb, wb) + if HAS_PROC_IO_COUNTERS: + @wrap_exceptions + def io_counters(self): + try: + rc, wc, rb, wb = cext.proc_io_counters(self.pid) + except OSError: + # if process is terminated, proc_io_counters returns OSError + # instead of NSP + if not pid_exists(self.pid): + raise NoSuchProcess(self.pid, self._name) + raise + return _common.pio(rc, wc, rb, wb) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/_psutil_aix.c new/psutil-5.6.1/psutil/_psutil_aix.c --- old/psutil-5.6.0/psutil/_psutil_aix.c 2019-03-02 21:46:28.000000000 +0100 +++ new/psutil-5.6.1/psutil/_psutil_aix.c 2019-03-05 13:34:36.000000000 +0100 @@ -13,7 +13,9 @@ * * Known limitations: * - psutil.Process.io_counters read count is always 0 + * - psutil.Process.io_counters may not be available on older AIX versions * - psutil.Process.threads may not be available on older AIX versions + # - psutil.net_io_counters may not be available on older AIX versions * - reading basic process info may fail or return incorrect values when * process is starting (see IBM APAR IV58499 - fixed in newer AIX versions) * - sockets and pipes may not be counted in num_fds (fixed in newer AIX @@ -172,6 +174,7 @@ #ifdef CURR_VERSION_THREAD + /* * Retrieves all threads used by process returning a list of tuples * including thread id, user time and system time. @@ -237,9 +240,12 @@ free(threadt); return NULL; } + #endif +#ifdef CURR_VERSION_PROCESS + static PyObject * psutil_proc_io_counters(PyObject *self, PyObject *args) { long pid; @@ -263,6 +269,8 @@ procinfo.outBytes); } +#endif + /* * Return process user and system CPU times as a Python tuple. @@ -469,6 +477,8 @@ } +#if defined(CURR_VERSION_NETINTERFACE) && CURR_VERSION_NETINTERFACE >= 3 + /* * Return a list of tuples for network I/O statistics. */ @@ -538,6 +548,8 @@ return NULL; } +#endif + static PyObject* psutil_net_if_stats(PyObject* self, PyObject* args) { @@ -878,8 +890,10 @@ {"proc_threads", psutil_proc_threads, METH_VARARGS, "Return process threads"}, #endif +#ifdef CURR_VERSION_PROCESS {"proc_io_counters", psutil_proc_io_counters, METH_VARARGS, "Get process I/O counters."}, +#endif {"proc_num_ctx_switches", psutil_proc_num_ctx_switches, METH_VARARGS, "Get process I/O counters."}, @@ -898,8 +912,10 @@ "Return system virtual memory usage statistics"}, {"swap_mem", psutil_swap_mem, METH_VARARGS, "Return stats about swap memory, in bytes"}, +#if defined(CURR_VERSION_NETINTERFACE) && CURR_VERSION_NETINTERFACE >= 3 {"net_io_counters", psutil_net_io_counters, METH_VARARGS, "Return a Python dict of tuples for network I/O statistics."}, +#endif {"net_connections", psutil_net_connections, METH_VARARGS, "Return system-wide connections"}, {"net_if_stats", psutil_net_if_stats, METH_VARARGS, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/_psutil_windows.c new/psutil-5.6.1/psutil/_psutil_windows.c --- old/psutil-5.6.0/psutil/_psutil_windows.c 2019-03-02 21:46:28.000000000 +0100 +++ new/psutil-5.6.1/psutil/_psutil_windows.c 2019-03-11 12:16:42.000000000 +0100 @@ -771,91 +771,110 @@ } +static int +psutil_GetProcWsetInformation( + DWORD pid, + HANDLE hProcess, + PMEMORY_WORKING_SET_INFORMATION *wSetInfo) +{ + NTSTATUS status; + PVOID buffer; + SIZE_T bufferSize; + + bufferSize = 0x8000; + buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, bufferSize); + + while ((status = psutil_NtQueryVirtualMemory( + hProcess, + NULL, + MemoryWorkingSetInformation, + buffer, + bufferSize, + NULL)) == STATUS_INFO_LENGTH_MISMATCH) + { + HeapFree(GetProcessHeap(), 0, buffer); + bufferSize *= 2; + psutil_debug("NtQueryVirtualMemory increase bufsize %zd", bufferSize); + // Fail if we're resizing the buffer to something very large. + if (bufferSize > 256 * 1024 * 1024) { + PyErr_SetString(PyExc_RuntimeError, + "NtQueryVirtualMemory bufsize is too large"); + return 1; + } + buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, bufferSize); + } -/** + if (!NT_SUCCESS(status)) { + if (status == STATUS_ACCESS_DENIED) { + AccessDenied(""); + } + else if (psutil_pid_is_running(pid) == 0) { + NoSuchProcess(""); + } + else { + PyErr_Clear(); + psutil_debug("NtQueryVirtualMemory failed with %i", status); + PyErr_SetString(PyExc_RuntimeError, "NtQueryVirtualMemory failed"); + } + HeapFree(GetProcessHeap(), 0, buffer); + return 1; + } + + *wSetInfo = (PMEMORY_WORKING_SET_INFORMATION)buffer; + return 0; +} + + +/* * Returns the USS of the process. * Reference: * https://dxr.mozilla.org/mozilla-central/source/xpcom/base/ * nsMemoryReporterManager.cpp */ static PyObject * -psutil_proc_memory_uss(PyObject *self, PyObject *args) -{ +psutil_proc_memory_uss(PyObject *self, PyObject *args) { DWORD pid; - HANDLE proc; - PSAPI_WORKING_SET_INFORMATION tmp; - DWORD tmp_size = sizeof(tmp); - size_t entries; - size_t private_pages; - size_t i; - DWORD info_array_size; - // needed by QueryWorkingSet - DWORD access = PROCESS_QUERY_INFORMATION | PROCESS_VM_READ; - PSAPI_WORKING_SET_INFORMATION* info_array; - PyObject* py_result = NULL; - unsigned long long total = 0; + HANDLE hProcess; + PSUTIL_PROCESS_WS_COUNTERS wsCounters; + PMEMORY_WORKING_SET_INFORMATION wsInfo; + ULONG_PTR i; if (! PyArg_ParseTuple(args, "l", &pid)) return NULL; - - proc = psutil_handle_from_pid(pid, access); - if (proc == NULL) + hProcess = psutil_handle_from_pid(pid, PROCESS_QUERY_LIMITED_INFORMATION); + if (hProcess == NULL) return NULL; - // Determine how many entries we need. - memset(&tmp, 0, tmp_size); - if (!QueryWorkingSet(proc, &tmp, tmp_size)) { - // NB: QueryWorkingSet is expected to fail here due to the - // buffer being too small. - if (tmp.NumberOfEntries == 0) { - PyErr_SetFromWindowsErr(0); - goto done; - } - } - - // Fudge the size in case new entries are added between calls. - entries = tmp.NumberOfEntries * 2; - - if (!entries) { - goto done; - } - - info_array_size = tmp_size + \ - ((DWORD)entries * sizeof(PSAPI_WORKING_SET_BLOCK)); - info_array = (PSAPI_WORKING_SET_INFORMATION*)malloc(info_array_size); - if (!info_array) { - PyErr_NoMemory(); - goto done; - } - - if (!QueryWorkingSet(proc, info_array, info_array_size)) { - PyErr_SetFromWindowsErr(0); - goto done; + if (psutil_GetProcWsetInformation(pid, hProcess, &wsInfo) != 0) { + CloseHandle(hProcess); + return NULL; } + memset(&wsCounters, 0, sizeof(PSUTIL_PROCESS_WS_COUNTERS)); - entries = (size_t)info_array->NumberOfEntries; - private_pages = 0; - for (i = 0; i < entries; i++) { - // Count shared pages that only one process is using as private. - if (!info_array->WorkingSetInfo[i].Shared || - info_array->WorkingSetInfo[i].ShareCount <= 1) { - private_pages++; + for (i = 0; i < wsInfo->NumberOfEntries; i++) { + // This is what ProcessHacker does. + /* + wsCounters.NumberOfPages++; + if (wsInfo->WorkingSetInfo[i].ShareCount > 1) + wsCounters.NumberOfSharedPages++; + if (wsInfo->WorkingSetInfo[i].ShareCount == 0) + wsCounters.NumberOfPrivatePages++; + if (wsInfo->WorkingSetInfo[i].Shared) + wsCounters.NumberOfShareablePages++; + */ + + // This is what we do: count shared pages that only one process + // is using as private (USS). + if (!wsInfo->WorkingSetInfo[i].Shared || + wsInfo->WorkingSetInfo[i].ShareCount <= 1) { + wsCounters.NumberOfPrivatePages++; } } - total = private_pages * PSUTIL_SYSTEM_INFO.dwPageSize; - py_result = Py_BuildValue("K", total); - -done: - if (proc) { - CloseHandle(proc); - } - - if (info_array) { - free(info_array); - } + HeapFree(GetProcessHeap(), 0, wsInfo); + CloseHandle(hProcess); - return py_result; + return Py_BuildValue("I", wsCounters.NumberOfPrivatePages); } @@ -1565,7 +1584,8 @@ // TCP IPv6 if ((PySequence_Contains(py_af_filter, _AF_INET6) == 1) && - (PySequence_Contains(py_type_filter, _SOCK_STREAM) == 1)) + (PySequence_Contains(py_type_filter, _SOCK_STREAM) == 1) && + (psutil_rtlIpv6AddressToStringA != NULL)) { table = NULL; py_conn_tuple = NULL; @@ -1715,7 +1735,8 @@ // UDP IPv6 if ((PySequence_Contains(py_af_filter, _AF_INET6) == 1) && - (PySequence_Contains(py_type_filter, _SOCK_DGRAM) == 1)) + (PySequence_Contains(py_type_filter, _SOCK_DGRAM) == 1) && + (psutil_rtlIpv6AddressToStringA != NULL)) { table = NULL; py_conn_tuple = NULL; @@ -3357,6 +3378,17 @@ } +/* + * System memory page size as an int. + */ +static PyObject * +psutil_getpagesize(PyObject *self, PyObject *args) { + // XXX: we may want to use GetNativeSystemInfo to differentiate + // page size for WoW64 processes (but am not sure). + return Py_BuildValue("I", PSUTIL_SYSTEM_INFO.dwPageSize); +} + + // ------------------------ Python init --------------------------- static PyMethodDef @@ -3462,6 +3494,8 @@ "Return CPU frequency."}, {"sensors_battery", psutil_sensors_battery, METH_VARARGS, "Return battery metrics usage."}, + {"getpagesize", psutil_getpagesize, METH_VARARGS, + "Return system memory page size."}, // --- windows services {"winservice_enumerate", psutil_winservice_enumerate, METH_VARARGS, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/_pswindows.py new/psutil-5.6.1/psutil/_pswindows.py --- old/psutil-5.6.0/psutil/_pswindows.py 2019-03-03 22:32:03.000000000 +0100 +++ new/psutil-5.6.1/psutil/_pswindows.py 2019-03-11 12:16:42.000000000 +0100 @@ -36,6 +36,7 @@ from ._common import ENCODING from ._common import ENCODING_ERRS from ._common import isfile_strict +from ._common import memoize from ._common import memoize_when_activated from ._common import parse_environ_block from ._common import sockfam_to_enum @@ -229,6 +230,11 @@ return s.encode(ENCODING, ENCODING_ERRS) +@memoize +def getpagesize(): + return cext.getpagesize() + + # ===================================================================== # --- memory # ===================================================================== @@ -798,6 +804,7 @@ def memory_full_info(self): basic_mem = self.memory_info() uss = cext.proc_memory_uss(self.pid) + uss *= getpagesize() return pfullmem(*basic_mem + (uss, )) def memory_maps(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/arch/windows/global.c new/psutil-5.6.1/psutil/arch/windows/global.c --- old/psutil-5.6.0/psutil/arch/windows/global.c 2019-03-02 21:46:28.000000000 +0100 +++ new/psutil-5.6.1/psutil/arch/windows/global.c 2019-03-11 12:16:42.000000000 +0100 @@ -95,11 +95,6 @@ if (! psutil_rtlIpv4AddressToStringA) return 1; - psutil_rtlIpv6AddressToStringA = psutil_GetProcAddressFromLib( - "ntdll.dll", "RtlIpv6AddressToStringA"); - if (! psutil_rtlIpv6AddressToStringA) - return 1; - // minimum requirement: Win XP SP3 psutil_GetExtendedTcpTable = psutil_GetProcAddressFromLib( "iphlpapi.dll", "GetExtendedTcpTable"); @@ -127,9 +122,18 @@ if (! psutil_NtResumeProcess) return 1; + psutil_NtQueryVirtualMemory = psutil_GetProcAddressFromLib( + "ntdll", "NtQueryVirtualMemory"); + if (! psutil_NtQueryVirtualMemory) + return 1; + /* * Optional. */ + // not available on Wine + psutil_rtlIpv6AddressToStringA = psutil_GetProcAddressFromLib( + "ntdll.dll", "RtlIpv6AddressToStringA"); + // minimum requirement: Win Vista psutil_GetTickCount64 = psutil_GetProcAddress( "kernel32", "GetTickCount64"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/arch/windows/global.h new/psutil-5.6.1/psutil/arch/windows/global.h --- old/psutil-5.6.0/psutil/arch/windows/global.h 2019-03-02 21:46:28.000000000 +0100 +++ new/psutil-5.6.1/psutil/arch/windows/global.h 2019-03-11 12:16:42.000000000 +0100 @@ -68,3 +68,6 @@ _NtResumeProcess \ psutil_NtResumeProcess; + +_NtQueryVirtualMemory \ + psutil_NtQueryVirtualMemory; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/arch/windows/ntextapi.h new/psutil-5.6.1/psutil/arch/windows/ntextapi.h --- old/psutil-5.6.0/psutil/arch/windows/ntextapi.h 2019-03-02 21:46:28.000000000 +0100 +++ new/psutil-5.6.1/psutil/arch/windows/ntextapi.h 2019-03-11 12:16:42.000000000 +0100 @@ -13,6 +13,8 @@ #define STATUS_INFO_LENGTH_MISMATCH 0xc0000004 #define STATUS_BUFFER_TOO_SMALL 0xC0000023L #define SystemExtendedHandleInformation 64 +#define MemoryWorkingSetInformation 0x1 +#define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L) /* * ================================================================ @@ -378,6 +380,30 @@ } SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX; #endif +typedef struct _MEMORY_WORKING_SET_BLOCK { + ULONG_PTR Protection : 5; + ULONG_PTR ShareCount : 3; + ULONG_PTR Shared : 1; + ULONG_PTR Node : 3; +#ifdef _WIN64 + ULONG_PTR VirtualPage : 52; +#else + ULONG VirtualPage : 20; +#endif +} MEMORY_WORKING_SET_BLOCK, *PMEMORY_WORKING_SET_BLOCK; + +typedef struct _MEMORY_WORKING_SET_INFORMATION { + ULONG_PTR NumberOfEntries; + MEMORY_WORKING_SET_BLOCK WorkingSetInfo[1]; +} MEMORY_WORKING_SET_INFORMATION, *PMEMORY_WORKING_SET_INFORMATION; + +typedef struct _PSUTIL_PROCESS_WS_COUNTERS { + SIZE_T NumberOfPages; + SIZE_T NumberOfPrivatePages; + SIZE_T NumberOfSharedPages; + SIZE_T NumberOfShareablePages; +} PSUTIL_PROCESS_WS_COUNTERS, *PPSUTIL_PROCESS_WS_COUNTERS; + /* * ================================================================ * Type defs for modules loaded at runtime. @@ -465,4 +491,13 @@ HANDLE hProcess ); +typedef NTSTATUS (NTAPI *_NtQueryVirtualMemory) ( + HANDLE ProcessHandle, + PVOID BaseAddress, + int MemoryInformationClass, + PVOID MemoryInformation, + SIZE_T MemoryInformationLength, + PSIZE_T ReturnLength +); + #endif // __NTEXTAPI_H__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/tests/__init__.py new/psutil-5.6.1/psutil/tests/__init__.py --- old/psutil-5.6.0/psutil/tests/__init__.py 2019-03-05 12:39:07.000000000 +0100 +++ new/psutil-5.6.1/psutil/tests/__init__.py 2019-03-06 17:47:17.000000000 +0100 @@ -160,17 +160,16 @@ # --- support +HAS_CONNECTIONS_UNIX = POSIX and not SUNOS HAS_CPU_AFFINITY = hasattr(psutil.Process, "cpu_affinity") HAS_CPU_FREQ = hasattr(psutil, "cpu_freq") -HAS_CONNECTIONS_UNIX = POSIX and not SUNOS HAS_ENVIRON = hasattr(psutil.Process, "environ") -HAS_PROC_IO_COUNTERS = hasattr(psutil.Process, "io_counters") HAS_IONICE = hasattr(psutil.Process, "ionice") -HAS_MEMORY_FULL_INFO = 'uss' in psutil.Process().memory_full_info()._fields HAS_MEMORY_MAPS = hasattr(psutil.Process, "memory_maps") +HAS_NET_IO_COUNTERS = hasattr(psutil, "net_io_counters") HAS_PROC_CPU_NUM = hasattr(psutil.Process, "cpu_num") +HAS_PROC_IO_COUNTERS = hasattr(psutil.Process, "io_counters") HAS_RLIMIT = hasattr(psutil.Process, "rlimit") -HAS_THREADS = hasattr(psutil.Process, "threads") HAS_SENSORS_BATTERY = hasattr(psutil, "sensors_battery") try: HAS_BATTERY = HAS_SENSORS_BATTERY and bool(psutil.sensors_battery()) @@ -178,6 +177,7 @@ HAS_BATTERY = True HAS_SENSORS_FANS = hasattr(psutil, "sensors_fans") HAS_SENSORS_TEMPERATURES = hasattr(psutil, "sensors_temperatures") +HAS_THREADS = hasattr(psutil.Process, "threads") # --- misc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/tests/test_contracts.py new/psutil-5.6.1/psutil/tests/test_contracts.py --- old/psutil-5.6.0/psutil/tests/test_contracts.py 2019-02-28 23:30:16.000000000 +0100 +++ new/psutil-5.6.1/psutil/tests/test_contracts.py 2019-03-10 03:27:52.000000000 +0100 @@ -33,6 +33,7 @@ from psutil.tests import check_connection_ntuple from psutil.tests import get_kernel_version from psutil.tests import HAS_CONNECTIONS_UNIX +from psutil.tests import HAS_NET_IO_COUNTERS from psutil.tests import HAS_RLIMIT from psutil.tests import HAS_SENSORS_FANS from psutil.tests import HAS_SENSORS_TEMPERATURES @@ -251,6 +252,7 @@ for ifname, _ in psutil.net_if_stats().items(): self.assertIsInstance(ifname, str) + @unittest.skipIf(not HAS_NET_IO_COUNTERS, 'not supported') def test_net_io_counters(self): # Duplicate of test_system.py. Keep it anyway. for ifname, _ in psutil.net_io_counters(pernic=True).items(): @@ -291,8 +293,7 @@ some sanity checks against Process API's returned values. """ - def test_fetch_all(self): - valid_procs = 0 + def get_attr_names(self): excluded_names = set([ 'send_signal', 'suspend', 'resume', 'terminate', 'kill', 'wait', 'as_dict', 'parent', 'parents', 'children', 'memory_info_ex', @@ -307,55 +308,66 @@ if name in excluded_names: continue attrs.append(name) + return attrs - default = object() - failures = [] + def iter_procs(self): + attrs = self.get_attr_names() for p in psutil.process_iter(): with p.oneshot(): for name in attrs: - ret = default - try: - args = () - kwargs = {} - attr = getattr(p, name, None) - if attr is not None and callable(attr): - if name == 'rlimit': - args = (psutil.RLIMIT_NOFILE,) - elif name == 'memory_maps': - kwargs = {'grouped': False} - ret = attr(*args, **kwargs) - else: - ret = attr - valid_procs += 1 - except NotImplementedError: - msg = "%r was skipped because not implemented" % ( - self.__class__.__name__ + '.test_' + name) - warn(msg) - except (psutil.NoSuchProcess, psutil.AccessDenied) as err: - self.assertEqual(err.pid, p.pid) - if err.name: - # make sure exception's name attr is set - # with the actual process name - self.assertEqual(err.name, p.name()) - assert str(err) - assert err.msg - except Exception: - s = '\n' + '=' * 70 + '\n' - s += "FAIL: test_%s (proc=%s" % (name, p) - if ret != default: - s += ", ret=%s)" % repr(ret) - s += ')\n' - s += '-' * 70 - s += "\n%s" % traceback.format_exc() - s = "\n".join((" " * 4) + i for i in s.splitlines()) - s += '\n' - failures.append(s) - break - else: - if ret not in (0, 0.0, [], None, '', {}): - assert ret, ret - meth = getattr(self, name) - meth(ret, p) + yield (p, name) + + def call_meth(self, p, name): + args = () + kwargs = {} + attr = getattr(p, name, None) + if attr is not None and callable(attr): + if name == 'rlimit': + args = (psutil.RLIMIT_NOFILE,) + elif name == 'memory_maps': + kwargs = {'grouped': False} + return attr(*args, **kwargs) + else: + return attr + + def test_fetch_all(self): + valid_procs = 0 + default = object() + failures = [] + for p, name in self.iter_procs(): + ret = default + try: + ret = self.call_meth(p, name) + except NotImplementedError: + msg = "%r was skipped because not implemented" % ( + self.__class__.__name__ + '.test_' + name) + warn(msg) + except (psutil.NoSuchProcess, psutil.AccessDenied) as err: + self.assertEqual(err.pid, p.pid) + if err.name: + # make sure exception's name attr is set + # with the actual process name + self.assertEqual(err.name, p.name()) + assert str(err) + assert err.msg + except Exception: + s = '\n' + '=' * 70 + '\n' + s += "FAIL: test_%s (proc=%s" % (name, p) + if ret != default: + s += ", ret=%s)" % repr(ret) + s += ')\n' + s += '-' * 70 + s += "\n%s" % traceback.format_exc() + s = "\n".join((" " * 4) + i for i in s.splitlines()) + s += '\n' + failures.append(s) + break + else: + valid_procs += 1 + if ret not in (0, 0.0, [], None, '', {}): + assert ret, ret + meth = getattr(self, name) + meth(ret, p) if failures: self.fail(''.join(failures)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/tests/test_memory_leaks.py new/psutil-5.6.1/psutil/tests/test_memory_leaks.py --- old/psutil-5.6.0/psutil/tests/test_memory_leaks.py 2019-02-28 23:28:50.000000000 +0100 +++ new/psutil-5.6.1/psutil/tests/test_memory_leaks.py 2019-03-06 16:59:18.000000000 +0100 @@ -38,6 +38,7 @@ from psutil.tests import HAS_ENVIRON from psutil.tests import HAS_IONICE from psutil.tests import HAS_MEMORY_MAPS +from psutil.tests import HAS_NET_IO_COUNTERS from psutil.tests import HAS_PROC_CPU_NUM from psutil.tests import HAS_PROC_IO_COUNTERS from psutil.tests import HAS_RLIMIT @@ -534,6 +535,7 @@ @unittest.skipIf(TRAVIS and MACOS, "false positive on travis") @skip_if_linux() + @unittest.skipIf(not HAS_NET_IO_COUNTERS, 'not supported') def test_net_io_counters(self): self.execute(psutil.net_io_counters, nowrap=False) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/tests/test_misc.py new/psutil-5.6.1/psutil/tests/test_misc.py --- old/psutil-5.6.0/psutil/tests/test_misc.py 2019-02-27 16:51:13.000000000 +0100 +++ new/psutil-5.6.1/psutil/tests/test_misc.py 2019-03-06 17:49:49.000000000 +0100 @@ -42,8 +42,8 @@ from psutil.tests import get_test_subprocess from psutil.tests import HAS_BATTERY from psutil.tests import HAS_CONNECTIONS_UNIX -from psutil.tests import HAS_MEMORY_FULL_INFO from psutil.tests import HAS_MEMORY_MAPS +from psutil.tests import HAS_NET_IO_COUNTERS from psutil.tests import HAS_SENSORS_BATTERY from psutil.tests import HAS_SENSORS_FANS from psutil.tests import HAS_SENSORS_TEMPERATURES @@ -620,10 +620,10 @@ wrap_numbers.cache_clear('disk_io') wrap_numbers.cache_clear('?!?') - @unittest.skipIf( - not psutil.disk_io_counters() or not psutil.net_io_counters(), - "no disks or NICs available") + @unittest.skipIf(not HAS_NET_IO_COUNTERS, 'not supported') def test_cache_clear_public_apis(self): + if not psutil.disk_io_counters() or not psutil.net_io_counters(): + return self.skipTest("no disks or NICs available") psutil.disk_io_counters() psutil.net_io_counters() caches = wrap_numbers.cache_info() @@ -735,8 +735,9 @@ def test_pmap(self): self.assert_stdout('pmap.py', str(os.getpid())) - @unittest.skipIf(not HAS_MEMORY_FULL_INFO, "not supported") def test_procsmem(self): + if 'uss' not in psutil.Process().memory_full_info()._fields: + raise self.skipTest("not supported") self.assert_stdout('procsmem.py', stderr=DEVNULL) def test_killall(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/tests/test_posix.py new/psutil-5.6.1/psutil/tests/test_posix.py --- old/psutil-5.6.0/psutil/tests/test_posix.py 2019-02-26 22:31:44.000000000 +0100 +++ new/psutil-5.6.1/psutil/tests/test_posix.py 2019-03-05 13:34:36.000000000 +0100 @@ -25,6 +25,7 @@ from psutil.tests import APPVEYOR from psutil.tests import get_kernel_version from psutil.tests import get_test_subprocess +from psutil.tests import HAS_NET_IO_COUNTERS from psutil.tests import mock from psutil.tests import PYTHON_EXE from psutil.tests import reap_children @@ -339,6 +340,7 @@ @unittest.skipIf(SUNOS, "unreliable on SUNOS") @unittest.skipIf(TRAVIS, "unreliable on TRAVIS") @unittest.skipIf(not which('ifconfig'), "no ifconfig cmd") + @unittest.skipIf(not HAS_NET_IO_COUNTERS, "not supported") def test_nic_names(self): output = sh("ifconfig -a") for nic in psutil.net_io_counters(pernic=True).keys(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/tests/test_system.py new/psutil-5.6.1/psutil/tests/test_system.py --- old/psutil-5.6.0/psutil/tests/test_system.py 2019-02-26 22:31:44.000000000 +0100 +++ new/psutil-5.6.1/psutil/tests/test_system.py 2019-03-05 13:34:36.000000000 +0100 @@ -38,6 +38,7 @@ from psutil.tests import get_test_subprocess from psutil.tests import HAS_BATTERY from psutil.tests import HAS_CPU_FREQ +from psutil.tests import HAS_NET_IO_COUNTERS from psutil.tests import HAS_SENSORS_BATTERY from psutil.tests import HAS_SENSORS_FANS from psutil.tests import HAS_SENSORS_TEMPERATURES @@ -538,6 +539,7 @@ self.assertIn(mount, mounts) psutil.disk_usage(mount) + @unittest.skipIf(not HAS_NET_IO_COUNTERS, 'not supported') def test_net_io_counters(self): def check_ntuple(nt): self.assertEqual(nt[0], nt.bytes_sent) @@ -566,6 +568,7 @@ self.assertIsInstance(key, str) check_ntuple(ret[key]) + @unittest.skipIf(not HAS_NET_IO_COUNTERS, 'not supported') def test_net_io_counters_no_nics(self): # Emulate a case where no NICs are installed, see: # https://github.com/giampaolo/psutil/issues/1062 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil/tests/test_windows.py new/psutil-5.6.1/psutil/tests/test_windows.py --- old/psutil-5.6.0/psutil/tests/test_windows.py 2019-03-01 14:45:37.000000000 +0100 +++ new/psutil-5.6.1/psutil/tests/test_windows.py 2019-03-10 03:41:37.000000000 +0100 @@ -332,12 +332,19 @@ p = psutil.Process(self.pid) self.assertRaises(ValueError, p.send_signal, signal.SIGINT) - def test_exe(self): + def test_exe_and_name(self): for p in psutil.process_iter(): + # On Windows name() is never supposed to raise AccessDenied, + # see https://github.com/giampaolo/psutil/issues/627 try: - self.assertEqual(os.path.basename(p.exe()), p.name()) - except psutil.Error: + name = p.name() + except psutil.NoSuchProcess: pass + else: + try: + self.assertEqual(os.path.basename(p.exe()), name) + except psutil.Error: + continue def test_num_handles_increment(self): p = psutil.Process(os.getpid()) @@ -385,15 +392,6 @@ if failures: self.fail('\n' + '\n'.join(failures)) - def test_name_always_available(self): - # On Windows name() is never supposed to raise AccessDenied, - # see https://github.com/giampaolo/psutil/issues/627 - for p in psutil.process_iter(): - try: - p.name() - except psutil.NoSuchProcess: - pass - @unittest.skipIf(not sys.version_info >= (2, 7), "CTRL_* signals not supported") def test_ctrl_signals(self): @@ -407,16 +405,6 @@ self.assertRaises(psutil.NoSuchProcess, p.send_signal, signal.CTRL_BREAK_EVENT) - def test_compare_name_exe(self): - for p in psutil.process_iter(): - try: - a = os.path.basename(p.exe()) - b = p.name() - except (psutil.NoSuchProcess, psutil.AccessDenied): - pass - else: - self.assertEqual(a, b) - def test_username(self): self.assertEqual(psutil.Process().username(), win32api.GetUserNameEx(win32con.NameSamCompatible)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/psutil.egg-info/PKG-INFO new/psutil-5.6.1/psutil.egg-info/PKG-INFO --- old/psutil-5.6.0/psutil.egg-info/PKG-INFO 2019-03-05 13:00:57.000000000 +0100 +++ new/psutil-5.6.1/psutil.egg-info/PKG-INFO 2019-03-11 18:24:46.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: psutil -Version: 5.6.0 +Version: 5.6.1 Summary: Cross-platform lib for process and system monitoring in Python. Home-page: https://github.com/giampaolo/psutil Author: Giampaolo Rodola @@ -73,7 +73,7 @@ - **Sun Solaris** - **AIX** - ...both **32-bit** and **64-bit** architectures. Supported Python versions are **2.6**, **2.7** and 3.4+**. `PyPy <http://pypy.org/>`__ is also known to work. + ...both **32-bit** and **64-bit** architectures. Supported Python versions are **2.6**, **2.7** and **3.4+**. `PyPy <http://pypy.org/>`__ is also known to work. Author diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/psutil-5.6.0/scripts/procsmem.py new/psutil-5.6.1/scripts/procsmem.py --- old/psutil-5.6.0/scripts/procsmem.py 2018-12-08 12:30:24.000000000 +0100 +++ new/psutil-5.6.1/scripts/procsmem.py 2019-03-11 12:16:42.000000000 +0100 @@ -86,7 +86,7 @@ for p in procs[:86]: line = templ % ( p.pid, - p._info["username"][:7], + p._info["username"][:7] if p._info["username"] else "", " ".join(p._info["cmdline"])[:30], convert_bytes(p._uss), convert_bytes(p._pss) if p._pss != "" else "", ++++++ skip-flaky-i586.patch ++++++ --- psutil-5.6.1-orig/psutil/tests/test_contracts.py 2019-03-18 09:42:48.474895363 +0700 +++ psutil-5.6.1/psutil/tests/test_contracts.py 2019-03-20 18:25:02.356923046 +0700 @@ -330,7 +330,7 @@ else: return attr - def test_fetch_all(self): + def _test_fetch_all(self): valid_procs = 0 default = object() failures = [] ++++++ skip-test-missing-warnings.patch ++++++ diff -ru psutil-5.6.1-orig/psutil/tests/test_linux.py psutil-5.6.1/psutil/tests/test_linux.py --- psutil-5.6.1-orig/psutil/tests/test_linux.py 2019-03-18 09:42:48.474895363 +0700 +++ psutil-5.6.1/psutil/tests/test_linux.py 2019-03-18 10:56:59.227642825 +0700 @@ -362,7 +362,7 @@ self.assertIn( "inactive memory stats couldn't be determined", str(w.message)) - def test_avail_old_missing_fields(self): + def _test_avail_old_missing_fields(self): # Remove Active(file), Inactive(file) and SReclaimable # from /proc/meminfo and make sure the fallback is used # (free + cached), @@ -387,7 +387,7 @@ self.assertIn( "inactive memory stats couldn't be determined", str(w.message)) - def test_avail_old_missing_zoneinfo(self): + def _test_avail_old_missing_zoneinfo(self): # Remove /proc/zoneinfo file. Make sure fallback is used # (free + cached). with mock_open_content(
