commit e80c33b8970273c82a9a6ee7ceac1c8746e5203a293a401d4a5151b83020840a Author: Adrian Schröter Date: Fri May 3 21:58:24 2024 +0200 Sync from SUSE:SLFO:Main python-psutil revision a82315a9e4d7fb4cd16992dc6d51f73d diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/logind_y2038.patch b/logind_y2038.patch new file mode 100644 index 0000000..dca7e2b --- /dev/null +++ b/logind_y2038.patch @@ -0,0 +1,233 @@ +From 89b2d1896ffa8e5c9a8d9b89c3af0bb9027ce23b Mon Sep 17 00:00:00 2001 +From: Alberto Planas +Date: Tue, 22 Aug 2023 15:54:09 +0200 +Subject: [PATCH] Use logind instead of utmp because of Y2038 + +Bi-arch systems line x86-64 present the Y2038 problem, where an overflow +can be produced because some glibc compatibility decissions (see +https://github.com/thkukuk/utmpx/blob/main/Y2038.md for more +information) + +This patch uses logind from systemd instead of utmp on Linux systems, if +the systemd version is support the new API (>= 254). + +Signed-off-by: Alberto Planas +--- + INSTALL.rst | 4 +-- + psutil/_psutil_linux.c | 81 ++++++++++++++++++++++++++++++++++++++++-- + setup.py | 22 ++++++++++++ + 3 files changed, 102 insertions(+), 5 deletions(-) + +Index: psutil-5.9.5/INSTALL.rst +=================================================================== +--- psutil-5.9.5.orig/INSTALL.rst ++++ psutil-5.9.5/INSTALL.rst +@@ -17,12 +17,12 @@ Linux (build) + + Ubuntu / Debian:: + +- sudo apt-get install gcc python3-dev ++ sudo apt-get install gcc python3-dev libsystemd-dev + pip install --no-binary :all: psutil + + RedHat / CentOS:: + +- sudo yum install gcc python3-devel ++ sudo yum install gcc python3-devel systemd-devel + pip install --no-binary :all: psutil + + Alpine:: +Index: psutil-5.9.5/psutil/_psutil_linux.c +=================================================================== +--- psutil-5.9.5.orig/psutil/_psutil_linux.c ++++ psutil-5.9.5/psutil/_psutil_linux.c +@@ -14,7 +14,11 @@ + #include + #include + #include +-#include ++#ifdef SYSTEMD_LINUX ++ #include ++#else ++ #include ++#endif + #include + #include + #include +@@ -363,42 +367,102 @@ psutil_proc_cpu_affinity_set(PyObject *s + */ + static PyObject * + psutil_users(PyObject *self, PyObject *args) { ++#ifdef SYSTEMD_LINUX ++ char **sessions_list = NULL; ++#else + struct utmp *ut; ++#endif + PyObject *py_retlist = PyList_New(0); + PyObject *py_tuple = NULL; + PyObject *py_username = NULL; + PyObject *py_tty = NULL; + PyObject *py_hostname = NULL; + PyObject *py_user_proc = NULL; ++ double tstamp = 0.0; ++ pid_t pid = 0; + + if (py_retlist == NULL) + return NULL; ++#ifdef SYSTEMD_LINUX ++ int sessions = sd_get_sessions(&sessions_list); ++ for (int i = 0; i < sessions; i++) { ++ const char *session_id = sessions_list[i]; ++#else + setutent(); + while (NULL != (ut = getutent())) { ++#endif + py_tuple = NULL; + py_user_proc = NULL; ++ #ifdef SYSTEMD_LINUX ++ py_user_proc = Py_True; ++ #else + if (ut->ut_type == USER_PROCESS) + py_user_proc = Py_True; + else + py_user_proc = Py_False; ++ #endif ++ ++ #ifdef SYSTEMD_LINUX ++ char *username = NULL; ++ if (sd_session_get_username(session_id, &username) < 0) ++ goto error; ++ py_username = PyUnicode_DecodeFSDefault(username); ++ free(username); ++ #else + py_username = PyUnicode_DecodeFSDefault(ut->ut_user); ++ #endif + if (! py_username) + goto error; ++ ++ #ifdef SYSTEMD_LINUX ++ char *tty = NULL; ++ if (sd_session_get_tty(session_id, &tty) < 0) { ++ py_tty = PyUnicode_DecodeFSDefault("n/a"); ++ } else { ++ py_tty = PyUnicode_DecodeFSDefault(tty); ++ free(tty); ++ } ++ #else + py_tty = PyUnicode_DecodeFSDefault(ut->ut_line); ++ #endif + if (! py_tty) + goto error; ++ #ifdef SYSTEMD_LINUX ++ char *hostname = NULL; ++ if (sd_session_get_remote_host(session_id, &hostname) < 0) ++ goto error; ++ py_hostname = PyUnicode_DecodeFSDefault(hostname); ++ free(hostname); ++ #else + py_hostname = PyUnicode_DecodeFSDefault(ut->ut_host); ++ #endif + if (! py_hostname) + goto error; + ++ #ifdef SYSTEMD_LINUX ++ uint64_t usec = 0; ++ if (sd_session_get_start_time(session_id, &usec) < 0) ++ goto error; ++ tstamp = (double)usec / 1000000.0; ++ #else ++ tstamp = (double)ut->ut_tv.tv_sec; ++ #endif ++ ++ #ifdef SYSTEMD_LINUX ++ if (sd_session_get_leader(session_id, &pid) < 0) ++ goto error; ++ #else ++ pid = ut->ut_pid; ++ #endif ++ + py_tuple = Py_BuildValue( + "OOOdO" _Py_PARSE_PID, + py_username, // username + py_tty, // tty + py_hostname, // hostname +- (double)ut->ut_tv.tv_sec, // tstamp ++ tstamp, // tstamp + py_user_proc, // (bool) user process +- ut->ut_pid // process id ++ pid // process id + ); + if (! py_tuple) + goto error; +@@ -408,8 +472,15 @@ psutil_users(PyObject *self, PyObject *a + Py_CLEAR(py_tty); + Py_CLEAR(py_hostname); + Py_CLEAR(py_tuple); ++ #ifdef SYSTEMD_LINUX ++ free (sessions_list[i]); ++ #endif + } ++#ifdef SYSTEMD_LINUX ++ free(sessions_list); ++#else + endutent(); ++#endif + return py_retlist; + + error: +@@ -418,7 +489,11 @@ error: + Py_XDECREF(py_hostname); + Py_XDECREF(py_tuple); + Py_DECREF(py_retlist); ++#ifdef SYSTEMD_LINUX ++ free(sessions_list); ++#else + endutent(); ++#endif + return NULL; + } + +Index: psutil-5.9.5/setup.py +=================================================================== +--- psutil-5.9.5.orig/setup.py ++++ psutil-5.9.5/setup.py +@@ -184,6 +184,20 @@ def unix_can_compile(c_code): + shutil.rmtree(tempdir) + + ++def get_systemd_version(): ++ r = subprocess.run(["systemctl", "--version"], capture_output=True) ++ if r.returncode != 0: ++ return 0 ++ out = r.stdout.split() ++ if len(out) < 2: ++ return 0 ++ version = out[1] ++ try: ++ return int(version) ++ except ValueError: ++ return 0 ++ ++ + if WINDOWS: + def get_winver(): + maj, min = sys.getwindowsversion()[0:2] +@@ -302,10 +316,18 @@ elif LINUX: + if not unix_can_compile("#include "): + macros.append(("PSUTIL_ETHTOOL_MISSING_TYPES", 1)) + ++ libraries = [] ++ # Systemd >= 254 can replace utmp. See: ++ # https://github.com/thkukuk/utmpx/blob/main/utmp-to-logind.md ++ if get_systemd_version() >= 254: ++ macros.append(("SYSTEMD_LINUX", 1)) ++ libraries.append("systemd") ++ + macros.append(("PSUTIL_LINUX", 1)) + ext = Extension( + 'psutil._psutil_linux', + sources=sources + ['psutil/_psutil_linux.c'], ++ libraries=libraries, + define_macros=macros, + **py_limited_api) + diff --git a/mem-used-bsc1181475.patch b/mem-used-bsc1181475.patch new file mode 100644 index 0000000..5333ad4 --- /dev/null +++ b/mem-used-bsc1181475.patch @@ -0,0 +1,34 @@ +--- + psutil/_pslinux.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +Index: psutil-5.9.5/psutil/_pslinux.py +=================================================================== +--- psutil-5.9.5.orig/psutil/_pslinux.py ++++ psutil-5.9.5/psutil/_pslinux.py +@@ -474,12 +474,6 @@ def virtual_memory(): + except KeyError: + slab = 0 + +- used = total - free - cached - buffers +- if used < 0: +- # May be symptomatic of running within a LCX container where such +- # values will be dramatically distorted over those of the host. +- used = total - free +- + # - starting from 4.4.0 we match free's "available" column. + # Before 4.4.0 we calculated it as (free + buffers + cached) + # which matched htop. +@@ -510,6 +504,12 @@ def virtual_memory(): + # 24fd2605c51fccc375ab0287cec33aa767f06718/proc/sysinfo.c#L764 + avail = free + ++ used = total - avail ++ if used < 0: ++ # May be symptomatic of running within a LCX container where such ++ # values will be dramatically distorted over those of the host. ++ used = total - free ++ + percent = usage_percent((total - avail), total, round_=1) + + # Warn about missing metrics which are set to 0. diff --git a/psutil-5.9.5.tar.gz b/psutil-5.9.5.tar.gz new file mode 100644 index 0000000..9fba3bb --- /dev/null +++ b/psutil-5.9.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5410638e4df39c54d957fc51ce03048acd8e6d60abc0f5107af51e5fb566eb3c +size 493489 diff --git a/python-psutil.changes b/python-psutil.changes new file mode 100644 index 0000000..63bf3b1 --- /dev/null +++ b/python-psutil.changes @@ -0,0 +1,1553 @@ +------------------------------------------------------------------- +Wed Sep 6 11:23:59 UTC 2023 - Dominique Leuenberger + +- BuildRequire /usr/bin/who: called by the test suite. With + coreutils 9.4 'who' is no longer part of the main package but is + shipped as part of coreutils-systemd. + +------------------------------------------------------------------- +Wed Aug 23 09:40:44 UTC 2023 - Alberto Planas Dominguez + +- Add logind_y2038.patch to use logind if systemd >= 254 is used, to + fix the issue of ut_tv.tv_sec and the Y2038 problem. + +------------------------------------------------------------------- +Wed May 3 09:04:54 UTC 2023 - Dirk Müller + +- update to 5.9.5: + * in case of exception, display a cleaner error + traceback by hiding the `KeyError` bit deriving from a + missed cache hit. + * print the full traceback when a `DeprecationWarning` + or `UserWarning` is raised. + * there are cases where `Process.cwd()`_ cannot be + determined (e.g. directory no longer exists), in which case + we returned either ``None`` or an empty string. + This was consolidated and we now return ``""`` on all + platforms. + * [UNIX]: if process is a zombie, and we can only + determine part of the its truncated `Process.name()`_ + (15 chars), don't fail with `ZombieProcess`_ when we try + to guess the full name from the `Process.cmdline()`_. Just + return the truncated name. + * on certain kernels, ``"MemAvailable"`` field + from ``/proc/meminfo`` returns ``0`` (possibly a kernel bug), in + which case we calculate an approximation for ``available`` + memory which matches "free" CLI utility. + * `disk_partitions()`_: do not unnecessarily + read /proc/filesystems and raise `AccessDenied`_ unless user + specified `all=False` argument. + * `users()`_ loses precision for ``started`` + attribute (off by 1 minute). + * if cwd no longer exists. Return an empty string instead. + +------------------------------------------------------------------- +Fri Apr 21 12:29:57 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Thu Apr 13 22:43:23 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Thu Dec 8 19:55:50 UTC 2022 - Ben Greiner + +- Require unittest2 only for python2: make this suitable for + the 15.4_py39 target in devel:languages:python:backports. +- Merge skip-obs.patch into skip_failing_tests.patch and add + test_linux.py::test_cpu_affinity because it depends on the + obs vm-type or worker CPU. + +------------------------------------------------------------------- +Mon Nov 7 20:52:52 UTC 2022 - Michael Ströder + +- update to version 5.9.4: + * Enhancements + - 2102: use Limited API when building wheels with CPython 3.6+ on Linux, + macOS and Windows. This allows to use pre-built wheels in all future + versions of cPython 3. (patch by Matthieu Darbois) + * Bug fixes + - 2077, [Windows]: Use system-level values for virtual_memory(). + (patch by Daniel Widdis) + - 2156, [Linux]: compilation may fail on very old gcc compilers due to + missing SPEED_UNKNOWN definition. (patch by Amir Rossert) + - 2010, [macOS]: on MacOS, arm64 IFM_1000_TX and IFM_1000_T are + the same value, causing a build failure. (patch by Lawrence D'Anna) + +------------------------------------------------------------------- +Sat Oct 22 16:23:10 UTC 2022 - Arun Persaud + +- update to version 5.9.3: + * Enhancements + + 2040, [macOS]: provide wheels for arm64 architecture. (patch by + Matthieu Darbois) + * Bug fixes + + 2116, [macOS], [critical]: `psutil.net_connections`_ fails with + RuntimeError. + + 2135, [macOS]: Process.environ() may contain garbage data. Fix + out-of-bounds read around sysctl_procargs. (patch by Bernhard + Urban-Forster) + + 2138, [Linux], [critical]: can't compile psutil on Android due + to undefined ethtool_cmd_speed symbol. + + 2142, [POSIX]: net_if_stats() 's flags on Python 2 returned + unicode instead of str. (patch by Matthieu Darbois) + + 2147, [macOS] Fix disk usage report on macOS 12+. (patch by + Matthieu Darbois) + + 2150, [Linux] Process.threads() may raise NoSuchProcess. Fix + race condition. (patch by Daniel Li) + + 2153, [macOS] Fix race condition in + test_posix.TestProcess.test_cmdline. (patch by Matthieu Darbois) + +------------------------------------------------------------------- +Sat Sep 10 15:41:34 UTC 2022 - Arun Persaud + +- update to version 5.9.2: + * Bug fixes + + 2093_, [FreeBSD], **[critical]**: `pids()`_ may fail with + ENOMEM. Dynamically increase the "malloc()" buffer size until + it's big enough. + + 2095_, [Linux]: `net_if_stats()`_ returns incorrect interface + speed for 100GbE network cards. + + 2113_, [FreeBSD], **[critical]**: `virtual_memory()`_ may raise + ENOMEM due to missing "#include " directive. + (patch by Peter Jeremy) + + 2128_, [NetBSD]: `swap_memory()`_ was miscalculated. (patch by + Thomas Klausner) + +------------------------------------------------------------------- +Fri Jul 15 07:59:26 UTC 2022 - Ben Greiner + +- Fix tests: setuptools changed the builddir library path and does + not find the module from it. Use the installed platlib instead + and exclude psutil.tests only later. +- Refresh skip-obs.patch + +------------------------------------------------------------------- +Thu Jun 23 11:09:31 UTC 2022 - Dr. Werner Fink + +- Add patch mem-used-bsc1181475.patch (bsc#1181475) + * Adopt change of used memory calculation from upstream of procps + +------------------------------------------------------------------- +Tue May 24 17:53:52 UTC 2022 - Michael Ströder + +- removed obsolete skip-partitions-erros.patch +- update to 5.9.1 + * Enhancements + - 1053: drop Python 2.6 support. (patches by Matthieu Darbois and Hugo van Kemenade) + - 2050, [Linux]: increase read(2) buffer size from 1k to 32k when reading /proc + pseudo files line by line. This should help having more consistent results. + - 2057, [OpenBSD]: add support for cpu_freq(). + - 2107, [Linux]: Process.memory_full_info() (reporting process USS/PSS/Swap memory) + now reads /proc/pid/smaps_rollup instead of /proc/pids/smaps, which makes it 5 times faster. + * Bug fixes + - 2048: AttributeError is raised if psutil.Error class is raised manually and passed through str. + - 2049, [Linux]: cpu_freq() erroneously returns curr value in GHz while min and max are in MHz. + - 2050, [Linux]: virtual_memory() may raise ValueError if running in a LCX container. + +------------------------------------------------------------------- +Wed Feb 2 17:30:32 UTC 2022 - Matej Cepl + +- Fix name of Patch4, it is skip-partitions-erros.patch + +------------------------------------------------------------------- +Sun Jan 30 01:38:45 UTC 2022 - Matej Cepl + +- Add skip-partitions-erros.patch skipping tests failing on Linux + (gh#giampaolo/psutil#2043). + +------------------------------------------------------------------- +Mon Jan 10 22:51:40 UTC 2022 - Dirk Müller + +- update to 5.9.0: + * [Linux]: `cpu_freq()`_ is slow on systems with many CPUs. Read current + frequency values for all CPUs from ``/proc/cpuinfo`` instead of opening many + files in ``/sys`` fs. (patch by marxin) + * `NoSuchProcess`_ message now specifies if the PID has been reused. + * error classes (`NoSuchProcess`_, `AccessDenied`_, etc.) now have a better + formatted and separated ``__repr__`` and ``__str__`` implementations. + * [Linux]: `disk_partitions()`_: convert ``/dev/root`` device (an alias + used on some Linux distros) to real root device path. + * ``PSUTIL_DEBUG`` mode now prints file name and line number of the debug + messages coming from C extension modules. + * rewrite HISTORY.rst to use hyperlinks pointing to psutil API doc. + * [Linux]: `wait_procs()`_ should catch ``subprocess.TimeoutExpired`` + exception. + * [Linux]: `sensors_battery()`_ can raise ``TypeError`` on PureOS. + * [Linux]: psutil does not handle ``ENAMETOOLONG`` when accessing process + file descriptors in procfs. (patch by Nikita Radchenko) + * **[critical]**: ``memoize_when_activated`` decorator is not thread-safe. + * **[critical]**: `process_iter()`_ is not thread safe and can raise + ``TypeError`` if invoked from multiple threads. + * [Linux]: `cpu_freq()`_ return order is wrong on systems with more than + 9 CPUs. + +------------------------------------------------------------------- +Thu Nov 25 04:05:30 UTC 2021 - Steve Kowalik + +- Update skip-obs.patch to also skip TestProcess.test_ionice_linux + +------------------------------------------------------------------- +Wed May 12 20:14:46 UTC 2021 - Enrico Belleri + +- remove the dependency on net-tools, since it conflicts with + busybox-hostnmame which is default on MicroOS. boo#1184753 + +------------------------------------------------------------------- +Fri Jan 29 08:19:00 UTC 2021 - Antonio Larrosa + +- Do not install tests (and change the way they're run since they + were run from %{buildroot}) + +------------------------------------------------------------------- +Thu Jan 28 16:25:35 UTC 2021 - Antonio Larrosa + +- Add patch to skip tests related to rlimit and zombie processes + that fail when building for python2 on i586: + * skip_rlimit_tests_on_python2.patch + +------------------------------------------------------------------- +Mon Jan 25 16:03:37 UTC 2021 - Antonio Larrosa + +- update to 5.8.0: + * Enhancements: + - 1863: disk_partitions() exposes 2 extra fields: maxfile and + maxpath, which are the maximum file name and path name + length. + - 1872: [Windows] added support for PyPy 2.7. + - 1879: provide pre-compiled wheels for Linux and macOS. + - 1880: get rid of Travis and Cirrus CI services (they are no + longer free). CI testing is now done by GitHub Actions on + Linux, macOS and FreeBSD (yes). AppVeyor is still being used + for Windows CI. + * Bug fixes: + - 1708: [Linux] get rid of sensors_temperatures() duplicates. + (patch by Tim Schlueter). + - 1839: [Windows] always raise AccessDenied when failing to + query 64 processes from 32 bit ones (NtWoW64 APIs). + - 1866: [Windows] process exe(), cmdline(), environ() may raise + "invalid access to memory location" on Python 3.9. + - 1874: [Solaris] wrong swap output given when encrypted column + is present. + - 1875: [Windows] process username() may raise + ERROR_NONE_MAPPED if the SID has no corresponding account + name. In this case AccessDenied is now raised. + - 1877: [Windows] OpenProcess may fail with ERROR_SUCCESS. + Turn it into AccessDenied or NoSuchProcess depending on + whether the PID is alive. + - 1886: [macOS] EIO error may be raised on cmdline() and + environment(). Now it gets translated into AccessDenied. + - 1891: [macOS] get rid of deprecated getpagesize(). +- Rebase patch and skip three other tests that fail on obs + * skip-obs.patch + +------------------------------------------------------------------- +Fri Dec 11 12:19:05 UTC 2020 - Benjamin Greiner + +- Only require unittest2 for Leap. + +------------------------------------------------------------------- +Fri Dec 11 11:36:23 UTC 2020 - Andreas Schneider + +- Add missing BR for unittest2 + +------------------------------------------------------------------- +Tue Dec 1 12:55:06 UTC 2020 - Dirk Mueller + +- update to 5.7.3: + - 809_: [FreeBSD] add support for `Process.rlimit()`. + - 893_: [BSD] add support for `Process.environ()` (patch by Armin Gruner) + - 1830_: [UNIX] `net_if_stats()`'s `isup` also checks whether the NIC is + running (meaning Wi-Fi or ethernet cable is connected). + - 1837_: [Linux] improved battery detection and charge "secsleft" calculation + - 1620_: [Linux] physical cpu_count() result is incorrect on systems with more + than one CPU socket. + - 1738_: [macOS] Process.exe() may raise FileNotFoundError if process is still + alive but the exe file which launched it got deleted. + - 1791_: [macOS] fix missing include for getpagesize(). + - 1823_: [Windows] Process.open_files() may cause a segfault due to a NULL + pointer. + - 1838_: [Linux] sensors_battery(): if `percent` can be determined but not + the remaining values, still return a result instead of None. +- skip-obs.patch, skip_failing_tests.patch: rediff + +------------------------------------------------------------------- +Tue Nov 3 10:15:29 UTC 2020 - Benjamin Greiner + +- Fix shebang replacement for multiple python flavors + +------------------------------------------------------------------- +Wed Sep 16 21:09:55 UTC 2020 - Dirk Mueller + +- update to 5.7.2: + * parallel tests on UNIX (make test-parallel). They're twice as fast! + * 1741: "make build/install" is now run in parallel and it's about 15% faster on UNIX. + * 1747: Process.wait() on POSIX returns an enum, showing the negative signal which was used to terminate the process + * 1747: Process.wait() return value is cached so that the exit code can be retrieved on then next call. + * 1747: Process provides more info about the process on str() and repr() (status and exit code): + * 1757: memory leak tests are now stable. + * 1768: [Windows] added support for Windows Nano Server. (contributed by Julien Lebot) + * 1726: [Linux] cpu_freq() parsing should use spaces instead of tabs on ia64. (patch by Michał Górny) + * 1760: [Linux] Process.rlimit() does not handle long long type properly. + * 1766: [macOS] NoSuchProcess may be raised instead of ZombieProcess. + * 1781: fix signature of callback function for getloadavg(). (patch by Ammar Askar) + - remove skip-flaky-i586.patch (obsolete) + +------------------------------------------------------------------- +Fri Aug 21 15:27:11 UTC 2020 - Matej Cepl + +- Add skip_failing_tests.patch to skip tests failing because of + incomplete emulation of the environment in osc build + environment (gh#giampaolo/psutil#1635). + +------------------------------------------------------------------- +Sat Mar 14 07:25:43 UTC 2020 - Tomáš Chvátal + +- Update to 5.7.0: + * Various fixes to build with updated kernel/etc. +- Remove merged patch pr_1665.patch and pr_1364.patch +- Update patch skip-obs.patch +- Remove skip-test-missing-warnings.patch as it can be fixed by + properly calling the tests + +------------------------------------------------------------------- +Wed Jan 29 16:58:27 UTC 2020 - Dominique Leuenberger + +- Add pr_1665.patch: Future-proof disk_io_counters on Linux. Fixes + tests with Linux 5.5. + +------------------------------------------------------------------- +Thu Nov 28 17:10:26 UTC 2019 - Arun Persaud + +- update to version 5.6.7: + * Bug fixes + + 1630: [Windows] can't compile source distribution due to C + syntax error. + +- changes from version 5.6.6: + * Bug fixes + + 1179: [Linux] Process cmdline() now takes into account + misbehaving processes renaming the command line and using + inappropriate chars to separate args. + + 1616: use of Py_DECREF instead of Py_CLEAR will result in double + free and segfault (CVE). (patch by Riccardo Schirone) + + 1619: [OpenBSD] compilation fails due to C syntax error. (patch + by Nathan Houghton) + +------------------------------------------------------------------- +Sat Nov 9 14:42:18 UTC 2019 - Arun Persaud + +- update to version 5.6.5: + * Bug fixes + + 1615: remove pyproject.toml as it was causing installation + issues. + +- changes from version 5.6.4: + * Enhancements + + 1527: [Linux] added Process.cpu_times().iowait counter, which is + the time spent waiting for blocking I/O to complete. + + 1565: add PEP 517/8 build backend and requirements specification + for better pip integration. (patch by Bernát Gábor) + * Bug fixes + + 875: [Windows] Process' cmdline(), environ() or cwd() may + occasionally fail with ERROR_PARTIAL_COPY which now gets + translated to AccessDenied. + + 1126: [Linux] cpu_affinity() segfaults on CentOS 5 / + manylinux. cpu_affinity() support for CentOS 5 was removed. + + 1528: [AIX] compilation error on AIX 7.2 due to 32 vs 64 bit + differences. (patch by Arnon Yaari) + + 1535: 'type' and 'family' fields returned by net_connections() + are not always turned into enums. + + 1536: [NetBSD] process cmdline() erroneously raise ZombieProcess + error if cmdline has non encodable chars. + + 1546: usage percent may be rounded to 0 on Python 2. + + 1552: [Windows] getloadavg() math for calculating 5 and 15 mins + values is incorrect. + + 1568: [Linux] use CC compiler env var if defined. + + 1570: [Windows] NtWow64* syscalls fail to raise the proper error + code + + 1585: [OSX] calling close() (in C) on possible negative + integers. (patch by Athos Ribeiro) + + 1606: [SunOS] compilation fails on SunOS 5.10. (patch by vser1) + +------------------------------------------------------------------- +Tue Sep 10 13:08:41 UTC 2019 - Tomáš Chvátal + +- Add patch to skip more tests that won't work in OBS: + * skip-obs.patch + +------------------------------------------------------------------- +Tue Jul 23 11:01:40 UTC 2019 - Tomáš Chvátal + +- Update to 5.6.3: + * 1494: [AIX] added support for Process.environ(). (patch by Arnon Yaari) + * 1276: [AIX] can't get whole cmdline(). (patch by Arnon Yaari) + * 1501_: [Windows] Process cmdline() and exe() raise unhandled "WinError 1168 element not found" exceptions for "Registry" and "Memory Compression" psuedo processes on Windows 10. + * 1526_: [NetBSD] process cmdline() could raise MemoryError. (patch by Kamil Rytarowski) + +------------------------------------------------------------------- +Sat May 25 13:16:59 UTC 2019 - Tomáš Chvátal + +- Update to 5.6.2: + * 1404: [Linux] cpu_count(logical=False) uses a second method (read from /sys/devices/system/cpu/cpu[0-9]/topology/core_id) in order to determine the number of physical CPUs in case /proc/cpuinfo does not provide this info. + * 1458: provide coloured test output. Also show failures on KeyboardInterrupt. + * 1464: various docfixes (always point to python3 doc, fix links, etc.). + * 1478: add make command to re-run tests failed on last run. + * 1456: [Linux] cpu_freq() returns None instead of 0.0 when min/max not available (patch by Alex Manuskin) + * 1462: [Linux] (tests) make tests invariant to LANG setting (patch by Benjamin Drung) + * 1463: cpu_distribution.py script was broken. + * 1470: [Linux] disk_partitions(): fix corner case when /etc/mtab doesn't exist. (patch by Cedric Lamoriniere) + * 1472: [Linux] cpu_freq() does not return all CPUs on Rasbperry-pi 3. + * 1493: [Linux] cpu_freq(): handle the case where /sys/devices/system/cpu/cpufreq/ exists but is empty. + +------------------------------------------------------------------- +Mon Mar 18 02:29:21 UTC 2019 - John Vandenberg + +- 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 + +------------------------------------------------------------------- +Sat Mar 9 15:45:36 UTC 2019 - Arun Persaud + +- update to version 5.6.0: + * Enhancements + + 1379: [Windows] Process suspend() and resume() now use + NtSuspendProcess and NtResumeProcess instead of + stopping/resuming all threads of a process. This is faster and + more reliable (aka this is what ProcessHacker does). + + 1420: [Windows] in case of exception disk_usage() now also shows + the path name. + + 1422: [Windows] Windows APIs requiring to be dynamically loaded + from DLL libraries are now loaded only once on startup (instead + of on per function 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. + * Bug fixes + + 1353: process_iter() is now thread safe (it rarely raised + TypeError). + + 1394: [Windows] Process name() and exe() may erroneously return + "Registry". QueryFullProcessImageNameW is now used instead of + GetProcessImageFileNameW in order to prevent that. + + 1411: [BSD] lack of Py_DECREF could cause segmentation fault on + process instantiation. + + 1419: [Windows] Process.environ() raises NotImplementedError + when querying a 64-bit process in 32-bit-WoW mode. Now it raises + AccessDenied. + + 1427: [OSX] Process cmdline() and environ() may erroneously + raise OSError on failed malloc(). + + 1429: [Windows] SE DEBUG was not properly set for current + process. It is now, and it should result in less AccessDenied + exceptions for low-pid processes. + + 1432: [Windows] Process.memory_info_ex()'s USS memory is + miscalculated because we're not using the actual system + PAGESIZE. + + 1439: [NetBSD] Process.connections() may return incomplete + results if using oneshot(). + + 1447: original exception wasn't turned into NSP/AD exceptions + when using Process.oneshot() ctx manager. + * Incompatible API changes + + 1291: [OSX] Process.memory_maps() was removed because inherently + broken (segfault) for years. + +------------------------------------------------------------------- +Sat Feb 16 17:23:16 UTC 2019 - Arun Persaud + +- update to version 5.5.1: + * Enhancements + + 1348: [Windows] on Windows >= 8.1 if Process.cmdline() fails due + to ERROR_ACCESS_DENIED attempt using NtQueryInformationProcess + + ProcessCommandLineInformation. (patch by EccoTheFlintstone) + * Bug fixes + + 1394: [Windows] Process.exe() returns "[Error 0] The operation + completed successfully" when Python process runs in "Virtual + Secure Mode". + + 1402: psutil exceptions' repr() show the internal private module + path. + + 1408: [AIX] psutil won't compile on AIX 7.1 due to missing + header. (patch by Arnon Yaari) + +------------------------------------------------------------------- +Sat Jan 26 17:39:46 UTC 2019 - Arun Persaud + +- specfile: + * update copyright year + +- update to version 5.5.0: + * Enhancements + + 1350: [FreeBSD] added support for sensors_temperatures(). (patch + by Alex Manuskin) + + 1352: [FreeBSD] added support for CPU frequency. (patch by Alex + Manuskin) + * Bug fixes + + 1111: Process.oneshot() is now thread safe. + + 1354: [Linux] disk_io_counters() fails on Linux kernel 4.18+. + + 1357: [Linux] Process' memory_maps() and io_counters() method + are no longer exposed if not supported by the kernel. + + 1368: [Windows] fix psutil.Process().ionice(...) + mismatch. (patch by EccoTheFlintstone) + + 1370: [Windows] improper usage of CloseHandle() may lead to + override the original error code when raising an exception. + + 1373: incorrect handling of cache in Process.oneshot() context + causes Process instances to return incorrect results. + + 1376: [Windows] OpenProcess() now uses + PROCESS_QUERY_LIMITED_INFORMATION access rights wherever + possible, resulting in less AccessDenied exceptions being thrown + for system processes. + + 1376: [Windows] check if variable is NULL before free()ing + it. (patch by EccoTheFlintstone) + +------------------------------------------------------------------- +Thu Nov 1 22:42:43 UTC 2018 - Arun Persaud + +- update to version 5.4.8: + * Enhancements + + 1197: [Linux] cpu_freq() is now implemented by parsing + /proc/cpuinfo in case /sys/devices/system/cpu/* filesystem is + not available. + + 1310: [Linux] psutil.sensors_temperatures() now parses + /sys/class/thermal in case /sys/class/hwmon fs is not available + (e.g. Raspberry Pi). (patch by Alex Manuskin) + + 1320: [Posix] better compilation support when using g++ instead + of gcc. (patch by Jaime Fullaondo) + * Bug fixes + + 715: do not print exception on import time in case cpu_times() + fails. + + 1004: [Linux] Process.io_counters() may raise ValueError. + + 1277: [OSX] available and used memory (psutil.virtual_memory()) + metrics are not accurate. + + 1294: [Windows] psutil.Process().connections() may sometimes + fail with intermittent 0xC0000001. (patch by Sylvain Duchesne) + + 1307: [Linux] disk_partitions() does not honour PROCFS_PATH. + + 1320: [AIX] system CPU times (psutil.cpu_times()) were being + reported with ticks unit as opposed to seconds. (patch by Jaime + Fullaondo) + + 1332: [OSX] psutil debug messages are erroneously printed all + the time. (patch by Ilya Yanok) + + 1346: [SunOS] net_connections() returns an empty list. (patch by + Oleksii Shevchuk) + +------------------------------------------------------------------- +Sat Aug 18 17:02:59 UTC 2018 - arun@gmx.de + +- update to version 5.4.7: + * Enhancements + + 1286: [macOS] psutil.OSX constant is now deprecated in favor of + new psutil.MACOS. + + 1309: [Linux] added psutil.STATUS_PARKED constant for + Process.status(). + + 1321: [Linux] add disk_io_counters() dual implementation relying + on /sys/block filesystem in case /proc/diskstats is not + available. (patch by Lawrence Ye) + * Bug fixes + + 1209: [macOS] Process.memory_maps() may fail with EINVAL due to + poor task_for_pid() syscall. AccessDenied is now raised instead. + + 1278: [macOS] Process.threads() incorrectly return microseconds + instead of seconds. (patch by Nikhil Marathe) + + 1279: [Linux, macOS, BSD] net_if_stats() may return ENODEV. + + 1294: [Windows] psutil.Process().connections() may sometime fail + with MemoryError. (patch by sylvainduchesne) + + 1305: [Linux] disk_io_stats() may report inflated r/w bytes + values. + + 1309: [Linux] Process.status() is unable to recognize "idle" and + "parked" statuses (returns '?'). + + 1313: [Linux] disk_io_counters() can report inflated IO counters + due to erroneously counting base disk device and its + partition(s) twice. + + 1323: [Linux] sensors_temperatures() may fail with ValueError. + +------------------------------------------------------------------- +Wed Jun 13 18:12:32 UTC 2018 - toddrme2178@gmail.com + +- Update to 5.4.6 + * 1258_: [Windows] Process.username() may cause a segfault (Python interpreter + crash). (patch by Jean-Luc Migot) + * 1273_: net_if_addr() namedtuple's name has been renamed from "snic" to + "snicaddr". + * 1274_: [Linux] there was a small chance Process.children() may swallow + AccessDenied exceptions. + +------------------------------------------------------------------- +Sat Apr 14 17:18:54 UTC 2018 - arun@gmx.de + +- update to version 5.4.5: + * Bug fixes + + 1268: setup.py's extra_require parameter requires latest + setuptools version, breaking quite a lot of installations. + +- changes from version 5.4.4: + * Enhancements + + 1239: [Linux] expose kernel "slab" memory for + psutil.virtual_memory(). (patch by Maxime Mouial) + * Bug fixes + + 694: [SunOS] cmdline() could be truncated at the 15th character + when reading it from /proc. An extra effort is made by reading + it from process address space first. (patch by Georg Sauthoff) + + 771: [Windows] cpu_count() (both logical and physical) return a + wrong (smaller) number on systems using process groups (> 64 + cores). + + 771: [Windows] cpu_times(percpu=True) return fewer CPUs on + systems using process groups (> 64 cores). + + 771: [Windows] cpu_stats() and cpu_freq() may return incorrect + results on systems using process groups (> 64 cores). + + 1193: [SunOS] Return uid/gid from /proc/pid/psinfo if there + aren't enough permissions for /proc/pid/cred. (patch by Georg + Sauthoff) + + 1194: [SunOS] Return nice value from psinfo as getpriority() + doesn't support real-time processes. (patch by Georg Sauthoff) + + 1194: [SunOS] Fix double free in psutil_proc_cpu_num(). (patch + by Georg Sauthoff) + + 1194: [SunOS] Fix undefined behavior related to strict-aliasing + rules and warnings. (patch by Georg Sauthoff) + + 1210: [Linux] cpu_percent() steal time may remain stuck at 100% + due to Linux erroneously reporting a decreased steal time + between calls. (patch by Arnon Yaari) + + 1216: fix compatibility with python 2.6 on Windows (patch by Dan + Vinakovsky) + + 1222: [Linux] Process.memory_full_info() was erroneously summing + "Swap:" and "SwapPss:". Same for "Pss:" and "SwapPss". Not + anymore. + + 1224: [Windows] Process.wait() may erroneously raise + TimeoutExpired. + + 1238: [Linux] sensors_battery() may return None in case battery + is not listed as "BAT0" under /sys/class/power_supply. + + 1240: [Windows] cpu_times() float loses accuracy in a long + running system. (patch by stswandering) + + 1245: [Linux] sensors_temperatures() may fail with IOError "no + such file". + + 1255: [FreeBSD] swap_memory() stats were erroneously represented + in KB. (patch by Denis Krienbühl) + * Backward compatibility + + 771: [Windows] cpu_count(logical=False) on Windows XP and Vista + is no longer supported and returns None. + +------------------------------------------------------------------- +Wed Jan 3 22:40:21 UTC 2018 - arun@gmx.de + +- specfile: + * update copyright year + +- update to version 5.4.3: + * Enhancements + + 775: disk_partitions() on Windows return mount points. + * Bug fixes + + 1193: pids() may return False on OSX. + +------------------------------------------------------------------- +Thu Dec 21 14:40:27 UTC 2017 - mihai.dinca@suse.com + +- build python3 subpackage (FATE#324435, bsc#1073879) + +------------------------------------------------------------------- +Thu Dec 7 16:47:30 UTC 2017 - arun@gmx.de + +- update to version 5.4.2: + * Enhancements + + 1173: introduced PSUTIL_DEBUG environment variable which can be + set in order to print useful debug messages on stderr (useful in + case of nasty errors). + + 1177: added support for sensors_battery() on OSX. (patch by + Arnon Yaari) + + 1183: Process.children() is 2x faster on UNIX and 2.4x faster on + Linux. + + 1188: deprecated method Process.memory_info_ex() now warns by + using FutureWarning instead of DeprecationWarning. + * Bug fixes + + 1152: [Windows] disk_io_counters() may return an empty dict. + + 1169: [Linux] users() "hostname" returns username + instead. (patch by janderbrain) + + 1172: [Windows] make test does not work. + + 1179: [Linux] Process.cmdline() is now able to splits cmdline + args for misbehaving processes which overwrite /proc/pid/cmdline + and use spaces instead of null bytes as args separator. + + 1181: [OSX] Process.memory_maps() may raise ENOENT. + + 1187: [OSX] pids() does not return PID 0 on recent OSX versions. + +------------------------------------------------------------------- +Fri Nov 10 22:54:03 UTC 2017 - arun@gmx.de + +- update to version 5.4.1: + * Enhancements + + 1164: [AIX] add support for Process.num_ctx_switches(). (patch + by Arnon Yaari) + + 1053: abandon Python 3.3 support (psutil still works but it's no + longer tested). + * Bug fixes + + 1150: [Windows] when a process is terminate()d now the exit code + is set to SIGTERM instead of 0. (patch by Akos Kiss) + + 1151: python -m psutil.tests fail + + 1154: [AIX] psutil won't compile on AIX 6.1.0. (patch by Arnon + Yaari) + + 1167: [Windows] net_io_counter() packets count now include also + non-unicast packets. (patch by Matthew Long) + +------------------------------------------------------------------- +Sun Oct 22 17:07:53 UTC 2017 - arun@gmx.de + +- update to version 5.4.0: + * Enhancements + + 1123: [AIX] added support for AIX platform. (patch by Arnon + Yaari) + * Bug fixes + + 1009: [Linux] sensors_temperatures() may crash with IOError. + + 1012: [Windows] disk_io_counters()'s read_time and write_time + were expressed in tens of micro seconds instead of milliseconds. + + 1127: [OSX] invalid reference counting in Process.open_files() + may lead to segfault. (patch by Jakub Bacic) + + 1129: [Linux] sensors_fans() may crash with IOError. (patch by + Sebastian Saip) + + 1131: [SunOS] fix compilation warnings. (patch by Arnon Yaari) + + 1133: [Windows] can't compile on newer versions of Visual Studio + 2017 15.4. (patch by Max Bélanger) + + 1138: [Linux] can't compile on CentOS 5.0 and RedHat 5.0. (patch + by Prodesire) + +------------------------------------------------------------------- +Mon Sep 25 09:17:26 UTC 2017 - michael@stroeder.com + +- update to version 5.3.1 + +**Enhancements** +- 1124_: documentation moved to http://psutil.readthedocs.io + +**Big fixes** +- 1105_: [FreeBSD] psutil does not compile on FreeBSD 12. +- 1125_: [BSD] net_connections() raises TypeError. + +**Compatibility notes** +- 1120_: .exe files for Windows are no longer uploaded on PYPI as per PEP-527; + only wheels are provided. + +------------------------------------------------------------------- +Fri Sep 8 19:17:33 UTC 2017 - michael@stroeder.com + +- update to version 5.3.0 + +**Enhancements** +- 802_: disk_io_counters() and net_io_counters() numbers no longer wrap + (restart from 0). Introduced a new "nowrap" argument. +- 928_: psutil.net_connections() and psutil.Process.connections() "laddr" and + "raddr" are now named tuples. +- 1015_: swap_memory() now relies on /proc/meminfo instead of sysinfo() syscall + so that it can be used in conjunction with PROCFS_PATH in order to retrieve + memory info about Linux containers such as Docker and Heroku. +- 1022_: psutil.users() provides a new "pid" field. +- 1025_: process_iter() accepts two new parameters in order to invoke + Process.as_dict(): "attrs" and "ad_value". With this you can iterate over all + processes in one shot without needing to catch NoSuchProcess and do list/dict + comprehensions. +- 1040_: implemented full unicode support. +- 1051_: disk_usage() on Python 3 is now able to accept bytes. +- 1058_: test suite now enables all warnings by default. +- 1060_: source distribution is dynamically generated so that it only includes + relevant files. +- 1079_: [FreeBSD] net_connections()'s fd number is now being set for real + (instead of -1). (patch by Gleb Smirnoff) +- 1091_: [SunOS] implemented Process.environ(). (patch by Oleksii Shevchuk) + +**Bug fixes** +- 989_: [Windows] boot_time() may return a negative value. +- 1007_: [Windows] boot_time() can have a 1 sec fluctuation between calls; the + value of the first call is now cached so that boot_time() always returns the + same value if fluctuation is <= 1 second. +- 1013_: [FreeBSD] psutil.net_connections() may return incorrect PID. (patch + by Gleb Smirnoff) +- 1014_: [Linux] Process class can mask legitimate ENOENT exceptions as + NoSuchProcess. +- 1016_: disk_io_counters() raises RuntimeError on a system with no disks. +- 1017_: net_io_counters() raises RuntimeError on a system with no network + cards installed. +- 1021_: [Linux] open_files() may erroneously raise NoSuchProcess instead of + skipping a file which gets deleted while open files are retrieved. +- 1029_: [OSX, FreeBSD] Process.connections('unix') on Python 3 doesn't + properly handle unicode paths and may raise UnicodeDecodeError. +- 1033_: [OSX, FreeBSD] memory leak for net_connections() and + Process.connections() when retrieving UNIX sockets (kind='unix'). +- 1040_: fixed many unicode related issues such as UnicodeDecodeError on + Python 3 + UNIX and invalid encoded data on Windows. +- 1042_: [FreeBSD] psutil won't compile on FreeBSD 12. +- 1044_: [OSX] different Process methods incorrectly raise AccessDenied for + zombie processes. +- 1046_: [Windows] disk_partitions() on Windows overrides user's SetErrorMode. +- 1047_: [Windows] Process username(): memory leak in case exception is thrown. +- 1048_: [Windows] users()'s host field report an invalid IP address. +- 1050_: [Windows] Process.memory_maps memory() leaks memory. +- 1055_: cpu_count() is no longer cached; this is useful on systems such as + Linux where CPUs can be disabled at runtime. This also reflects on + Process.cpu_percent() which no longer uses the cache. +- 1058_: fixed Python warnings. +- 1062_: disk_io_counters() and net_io_counters() raise TypeError if no disks + or NICs are installed on the system. +- 1063_: [NetBSD] net_connections() may list incorrect sockets. +- 1064_: [NetBSD] swap_memory() may segfault in case of error. +- 1065_: [OpenBSD] Process.cmdline() may raise SystemError. +- 1067_: [NetBSD] Process.cmdline() leaks memory if process has terminated. +- 1069_: [FreeBSD] Process.cpu_num() may return 255 for certain kernel + processes. +- 1071_: [Linux] cpu_freq() may raise IOError on old RedHat distros. +- 1074_: [FreeBSD] sensors_battery() raises OSError in case of no battery. +- 1075_: [Windows] net_if_addrs(): inet_ntop() return value is not checked. +- 1077_: [SunOS] net_if_addrs() shows garbage addresses on SunOS 5.10. + (patch by Oleksii Shevchuk) +- 1077_: [SunOS] net_connections() does not work on SunOS 5.10. (patch by + Oleksii Shevchuk) +- 1079_: [FreeBSD] net_connections() didn't list locally connected sockets. + (patch by Gleb Smirnoff) +- 1085_: cpu_count() return value is now checked and forced to None if <= 1. +- 1087_: Process.cpu_percent() guard against cpu_count() returning None and + assumes 1 instead. +- 1093_: [SunOS] memory_maps() shows wrong 64 bit addresses. +- 1094_: [Windows] psutil.pid_exists() may lie. Also, all process APIs relying + on OpenProcess Windows API now check whether the PID is actually running. +- 1098_: [Windows] Process.wait() may erroneously return sooner, when the PID + is still alive. +- 1099_: [Windows] Process.terminate() may raise AccessDenied even if the + process already died. +- 1101_: [Linux] sensors_temperatures() may raise ENODEV. + +**Porting notes** + +- 1039_: returned types consolidation: + - Windows / Process.cpu_times(): fields #3 and #4 were int instead of float + - Linux / FreeBSD: connections('unix'): raddr is now set to "" instead of + None + - OpenBSD: connections('unix'): laddr and raddr are now set to "" instead of + None +- 1040_: all strings are encoded by using OS fs encoding. +- 1040_: the following Windows APIs on Python 2 now return a string instead of + unicode: + - Process.memory_maps().path + - WindowsService.bin_path() + - WindowsService.description() + - WindowsService.display_name() + - WindowsService.username() + +------------------------------------------------------------------- +Tue Jul 11 14:24:34 UTC 2017 - toddrme2178@gmail.com + +- Fix various rpmlint warnings and errors + +------------------------------------------------------------------- +Sat Apr 29 16:13:29 UTC 2017 - michael@stroeder.com + +- update to version 5.2.2 + +**Bug fixes** +- 1000_: fixed some setup.py warnings. +- 1002_: [SunOS] remove C macro which will not be available on new Solaris + versions. (patch by Danek Duvall) +- 1004_: [Linux] Process.io_counters() may raise ValueError. +- 1006_: [Linux] cpu_freq() may return None on some Linux versions does not + support the function; now the function is not declared instead. +- 1009_: [Linux] sensors_temperatures() may raise OSError. +- 1010_: [Linux] virtual_memory() may raise ValueError on Ubuntu 14.04. +- 981_: [Linux] cpu_freq() may return an empty list. +- 993_: [Windows] Process.memory_maps() on Python 3 may raise + UnicodeDecodeError. +- 996_: [Linux] sensors_temperatures() may not show all temperatures. +- 997_: [FreeBSD] virtual_memory() may fail due to missing sysctl parameter on + FreeBSD 12. + +------------------------------------------------------------------- +Thu Mar 16 14:56:27 UTC 2017 - jmatejek@suse.com + +- update for singlespec + +------------------------------------------------------------------- +Wed Mar 15 13:52:27 UTC 2017 - michael@stroeder.com + +- update to version 5.2.0 + +**Enhancements** + +- 971_: [Linux] Add psutil.sensors_fans() function. (patch by Nicolas Hennion) +- 976_: [Windows] Process.io_counters() has 2 new fields: *other_count* and + *other_bytes*. +- 976_: [Linux] Process.io_counters() has 2 new fields: *read_chars* and + *write_chars*. + +**Bug fixes** + +- 872_: [Linux] can now compile on Linux by using MUSL C library. +- 985_: [Windows] Fix a crash in `Process.open_files` when the worker thread for `NtQueryObject` times out. +- 986_: [Linux] Process.cwd() may raise NoSuchProcess instead of ZombieProcess. + +------------------------------------------------------------------- +Wed Feb 8 14:40:55 UTC 2017 - michael@stroeder.com + +- update to version 5.1.3 + +5.1.3 +===== + +**Bug fixes** +- 971_: [Linux] sensors_temperatures() didn't work on CentOS 7. +- 973_: cpu_percent() may raise ZeroDivisionError. + +5.1.2 +===== + +*2017-02-03* + +**Bug fixes** +- 966_: [Linux] sensors_battery().power_plugged may erroneously return None on + Python 3. +- 968_: [Linux] disk_io_counters() raises TypeError on python 3. +- 970_: [Linux] sensors_battery()'s name and label fields on Python 3 are bytes + instead of str. + +5.1.1 +===== + +*2017-02-03* + +**Enhancements** +- 966_: [Linux] sensors_battery().percent is a float and is more precise. + +**Bug fixes** +- 964_: [Windows] Process.username() and psutil.users() may return badly + decoding character on Python 3. +- 965_: [Linux] disk_io_counters() may miscalculate sector size and report the + wrong number of bytes read and written. +- 966_: [Linux] sensors_battery() may fail with "no such file error". +- 966_: [Linux] sensors_battery().power_plugged may lie. + +5.1.0 +===== + +**Enhancements** +- 357_: added psutil.Process.cpu_num() (what CPU a process is on). +- 371_: added psutil.sensors_temperatures() (Linux only). +- 941_: added psutil.cpu_freq() (CPU frequency). +- 955_: added psutil.sensors_battery() (Linux, Windows, only). +- 956_: cpu_affinity([]) can now be used as an alias to set affinity against + all eligible CPUs. + +**Bug fixes** +- 687_: [Linux] pid_exists() no longer returns True if passed a process thread + ID. +- 948_: cannot install psutil with PYTHONOPTIMIZE=2. +- 950_: [Windows] Process.cpu_percent() was calculated incorrectly and showed + higher number than real usage. +- 951_: [Windows] the uploaded wheels for Python 3.6 64 bit didn't work. +- 959_: psutil exception objects could not be pickled. +- 960_: Popen.wait() did not return the correct negative exit status if process + is ``kill()``ed by a signal. +- 961_: [Windows] WindowsService.description() may fail with + ERROR_MUI_FILE_NOT_FOUND. + +5.0.1 +===== + +**Enhancements** +- 939_: tar.gz distribution went from 1.8M to 258K. +- 811_: [Windows] provide a more meaningful error message if trying to use + psutil on unsupported Windows XP. + +**Bug fixes** +- 609_: [SunOS] psutil does not compile on Solaris 10. +- 936_: [Windows] fix compilation error on VS 2013 (patch by Max Bélanger). +- 940_: [Linux] cpu_percent() and cpu_times_percent() was calculated + incorrectly as "iowait", "guest" and "guest_nice" times were not properly + taken into account. +- 944_: [OpenBSD] psutil.pids() was omitting PID 0. + +------------------------------------------------------------------- +Tue Nov 8 21:15:33 UTC 2016 - toddrme2178@gmail.com + +- update to version 5.0.0: + * Enhncements + + 799: new Process.oneshot() context manager making Process + methods around +2x faster in general and from +2x to +6x faster + on Windows. + + 943: better error message in case of version conflict on import. + * Bug fixes + + 932: [NetBSD] net_connections() and Process.connections() may + fail without raising an exception. + + 933: [Windows] memory leak in cpu_stats() and + WindowsService.description(). + +------------------------------------------------------------------- +Sat Nov 5 16:22:59 UTC 2016 - michael@stroeder.com + +- Update to version 4.4.2: + * 931: psutil no longer compiles on Solaris. + +------------------------------------------------------------------- +Tue Oct 25 18:13:08 UTC 2016 - michael@stroeder.com + +- Update to version 4.4.1: + * 927: Popen.__del__() may cause maximum recursion depth error. +- Update to version 4.4.0: + Enhancements + * 887: [Linux] virtual_memory()'s 'available' and 'used' + values are more precise and match "free" cmdline utility. + "available" also takes into account LCX containers + preventing "available" to overflow "total". + * 891: procinfo.py script has been updated and provides a + lot more info. + Bug fixes + * 825: [Linux] cpu_affinity; fix possible double close and + use of unopened socket. + * 885: ValueError is raised if a negative integer is passed + to cpu_percent() functions. + * 892: [Linux] Process.cpu_affinity([-1]) raise SystemError + with no error set; now ValueError is raised. + +------------------------------------------------------------------- +Sat Sep 24 12:36:35 UTC 2016 - michael@stroeder.com + +- update to version 4.3.1: + * #881: "make install" now works also when using a virtual env. + * #854: Process.as_dict() raises ValueError if passed an erroneous attrs name. + * #857: [SunOS] Process cpu_times(), cpu_percent(), threads() amd + memory_maps() may raise RuntimeError if attempting to query a 64bit + process with a 32bit python. "Null" values are returned as a fallback. + * #858: Process.as_dict() should not return memory_info_ex() because it's + deprecated. + * #863: [Windows] memory_map truncates addresses above 32 bits + * #866: [Windows] win_service_iter() and services in general are not able + to handle unicode service names / descriptions. + * #869: [Windows] Process.wait() may raise TimeoutExpired with wrong + timeout unit (ms instead of sec). + * #870: [Windows] Handle leak inside psutil_get_process_data. + +------------------------------------------------------------------- +Fri Jul 8 08:51:43 UTC 2016 - dmueller@suse.com + +- fix source url + +------------------------------------------------------------------- +Mon Jun 20 07:39:11 UTC 2016 - michael@stroeder.com + +- update to version 4.3.0: + * #819: [Linux] different speedup improvements: + Process.ppid() is 20% faster + Process.status() is 28% faster + Process.name() is 25% faster + Process.num_threads is 20% faster on Python 3 + * #810: [Windows] Windows wheels are incompatible with pip 7.1.2. + * #812: [NetBSD] fix compilation on NetBSD-5.x. + * #823: [NetBSD] virtual_memory() raises TypeError on Python 3. + * #829: [UNIX] psutil.disk_usage() percent field takes root reserved space + into account. + * #816: [Windows] fixed net_io_counter() values wrapping after 4.3GB in + Windows Vista (NT 6.0) and above using 64bit values from newer win APIs. + +------------------------------------------------------------------- +Mon May 30 07:28:01 UTC 2016 - tbechtold@suse.com + +- Update Source url + +------------------------------------------------------------------- +Sat May 28 11:34:45 UTC 2016 - michael@stroeder.com + +- update to version 4.2.0: + * Enhancements + + #795: [Windows] new APIs to deal with Windows services: + win_service_iter() and win_service_get(). + + #800: [Linux] psutil.virtual_memory() returns a new "shared" + memory field. + + #819: [Linux] speedup /proc parsing: - Process.ppid() is 20% + faster - Process.status() is 28% faster - Process.name() is 25% + faster - Process.num_threads is 20% faster on Python 3 + * Bug fixes + + #797: [Linux] net_if_stats() may raise OSError for certain NIC + cards. + + #813: Process.as_dict() should ignore extraneous attribute names + which gets attached to the Process instance. + +------------------------------------------------------------------- +Sun Mar 13 15:05:56 UTC 2016 - michael@stroeder.com + +- removed TODO from %doc, not in upstream tar-ball anymore +- update to version 4.1.0: + * Enhancements + + #777: [Linux] Process.open_files() on Linux return 3 new fields: + position, mode and flags. + + #779: Process.cpu_times() returns two new fields, + 'children_user' and 'children_system' (always set to 0 on OSX + and Windows). + + #789: [Windows] psutil.cpu_times() return two new fields: + "interrupt" and "dpc". Same for psutil.cpu_times_percent(). + + #792: new psutil.cpu_stats() function returning number of CPU + ctx switches interrupts, soft interrupts and syscalls. + * Bug fixes + + #774: [FreeBSD] net_io_counters() dropout is no longer set to 0 + if the kernel provides it. + + #776: [Linux] Process.cpu_affinity() may erroneously raise + NoSuchProcess. (patch by wxwright) + + #780: [OSX] psutil does not compile with some gcc versions. + + #786: net_if_addrs() may report incomplete MAC addresses. + + #788: [NetBSD] virtual_memory()'s buffers and shared values were + set to 0. + + #790: [OSX] psutil won't compile on OSX 10.4. + +------------------------------------------------------------------- +Wed Feb 17 19:18:13 UTC 2016 - michael@stroeder.com + +- update to version 4.0.0 + +**Enhancements** + +- #523: [Linux, FreeBSD] disk_io_counters() return a new "busy_time" field. +- #660: [Windows] make.bat is smarter in finding alternative VS install + locations. (patch by mpderbec) +- #732: Process.environ(). (patch by Frank Benkstein) +- #753: [Linux, OSX, Windows] Process USS and PSS (Linux) "real" memory stats. + (patch by Eric Rahm) +- #755: Process.memory_percent() "memtype" parameter. +- #758: tests now live in psutil namespace. +- #760: expose OS constants (psutil.LINUX, psutil.OSX, etc.) +- #756: [Linux] disk_io_counters() return 2 new fields: read_merged_count and + write_merged_count. +- #762: new scripts/procsmem.py script. + +**Bug fixes** + +- #704: [Solaris] psutil does not compile on Solaris sparc. +- #734: on Python 3 invalid UTF-8 data is not correctly handled for process + name(), cwd(), exe(), cmdline() and open_files() methods resulting in + UnicodeDecodeError exceptions. 'surrogateescape' error handler is now + used as a workaround for replacing the corrupted data. +- #737: [Windows] when the bitness of psutil and the target process was + different cmdline() and cwd() could return a wrong result or incorrectly + report an AccessDenied error. +- #741: [OpenBSD] psutil does not compile on mips64. +- #751: [Linux] fixed call to Py_DECREF on possible Null object. +- #754: [Linux] cmdline() can be wrong in case of zombie process. +- #759: [Linux] Process.memory_maps() may return paths ending with " (deleted)" +- #761: [Windows] psutil.boot_time() wraps to 0 after 49 days. +- #764: [NetBSD] fix compilation on NetBSD-6.x. +- #766: [Linux] net_connections() can't handle malformed /proc/net/unix file. +- #767: [Linux] disk_io_counters() may raise ValueError on 2.6 kernels and it's + broken on 2.4 kernels. +- #770: [NetBSD] disk_io_counters() metrics didn't update. + +------------------------------------------------------------------- +Thu Jan 21 09:01:36 UTC 2016 - michael@stroeder.com + +- update to version 3.4.2 (fixes for non-Linux platforms) + +------------------------------------------------------------------- +Fri Jan 15 19:39:31 UTC 2016 - michael@stroeder.com + +- update to version 3.4.1 + +**Enhancements** + +- #557: [NetBSD] added NetBSD support. (contributed by Ryo Onodera and + Thomas Klausner) +- #708: [Linux] psutil.net_connections() and Process.connections() on Python 2 + can be up to 3x faster in case of many connections. + Also psutil.Process.memory_maps() is slightly faster. +- #718: process_iter() is now thread safe. + +**Bug fixes** + +- #714: [OpenBSD] virtual_memory().cached value was always set to 0. +- #715: don't crash at import time if cpu_times() fail for some reason. +- #717: [Linux] Process.open_files fails if deleted files still visible. +- #722: [Linux] swap_memory() no longer crashes if sin/sout can't be determined + due to missing /proc/vmstat. +- #724: [FreeBSD] virtual_memory().total is slightly incorrect. + +------------------------------------------------------------------- +Fri Nov 27 10:57:57 UTC 2015 - michael@stroeder.com + +- update to version 3.3.0 + +**Enhancements** +- #558: [Linux] exposed psutil.PROCFS_PATH constant to change the default + location of /proc filesystem. +- #615: [OpenBSD] added OpenBSD support. (contributed by Landry Breuil) + +**Bug fixes** +- #692: [UNIX] Process.name() is no longer cached as it may change. + +------------------------------------------------------------------- +Mon Oct 26 21:09:10 UTC 2015 - michael@stroeder.com + +- update to version 3.2.2 + +**Bug fixes** + +- #623: [Linux] process or system connections raises ValueError if IPv6 is not + supported by the system. +- #678: [Linux] can't install psutil due to bug in setup.py. + +------------------------------------------------------------------- +Wed Sep 16 19:33:14 UTC 2015 - michael@stroeder.com + +- update to version 3.2.1 + * #677: [Linux] can't install psutil due to bug in setup.py. + +------------------------------------------------------------------- +Thu Sep 3 07:39:22 UTC 2015 - michael@stroeder.com + +- update to version 3.2.0 + +**Enhancements** + +- #644: [Windows] added support for CTRL_C_EVENT and CTRL_BREAK_EVENT signals + to use with Process.send_signal(). +- #648: CI test integration for OSX. (patch by Jeff Tang) +- #663: [UNIX] net_if_addrs() now returns point-to-point (VPNs) addresses. +- #655: [Windows] different issues regarding unicode handling were fixed. On + Python 2 all APIs returning a string will now return an encoded version of it + by using sys.getfilesystemencoding() codec. The APIs involved are: + - psutil.net_if_addrs() + - psutil.net_if_stats() + - psutil.net_io_counters() + - psutil.Process.cmdline() + - psutil.Process.name() + - psutil.Process.username() + - psutil.users() + +**Bug fixes** + +- #513: [Linux] fixed integer overflow for RLIM_INFINITY. +- #641: [Windows] fixed many compilation warnings. (patch by Jeff Tang) +- #652: [Windows] net_if_addrs() UnicodeDecodeError in case of non-ASCII NIC + names. +- #655: [Windows] net_if_stats() UnicodeDecodeError in case of non-ASCII NIC + names. +- #659: [Linux] compilation error on Suse 10. (patch by maozguttman) +- #664: [Linux] compilation error on Alpine Linux. (patch by Bart van Kleef) +- #670: [Windows] segfgault of net_if_addrs() in case of non-ASCII NIC names. + (patch by sk6249) +- #672: [Windows] compilation fails if using Windows SDK v8.0. (patch by + Steven Winfield) +- #675: [Linux] net_connections(); UnicodeDecodeError may occur when listing + UNIX sockets. + +------------------------------------------------------------------- +Wed Jul 15 12:55:51 UTC 2015 - michael@stroeder.com + +- update to version 3.1.1: + +New fatures +========= + +- [Linux] disk_partitions() added support for ZFS filesystems. +- continuous tests integration for Windows +- continuous code quality test integration + +Main bugfixes +=========== + +- [Windows] Process.open_files() no longer hangs. Instead it uses a + thred which times out and skips the file handle in case it's taking too +long + to be retrieved. (patch by Jeff Tang) +- [Windows] Process.name() no longer raises AccessDenied for pids owned + by another user. +- [Windows] Process.memory_info() no longer raises AccessDenied for pids + owned by another user. +- [Linux] Process.cmdline() can be truncated. +- [Windows] add inet_ntop function for Windows XP to support IPv6. + +------------------------------------------------------------------- +Mon Jun 29 11:08:33 UTC 2015 - toddrme2178@gmail.com + +- update to version 3.0.1: + * #632: [Linux] better error message if cannot parse process UNIX + connections. + * #634: [Linux] Proces.cmdline() does not include empty string + arguments. + * #635: [UNIX] crash on module import if 'enum' package is installed + on python < 3.4. +- update to version 3.0.0: + * Enhancements + + #250: new psutil.net_if_stats() returning NIC statistics (isup, + duplex, speed, MTU). + + #376: new psutil.net_if_addrs() returning all NIC addresses a-la + ifconfig. + + #469: on Python >= 3.4 IOPRIO_CLASS_* and *_PRIORITY_CLASS + constants returned by psutil.Process' ionice() and nice() + methods are enums instead of plain integers. + + #581: add .gitignore. (patch by Gabi Davar) + + #582: connection constants returned by psutil.net_connections() + and psutil.Process.connections() were turned from int to enums + on Python > 3.4. + + #587: Move native extension into the package. + + #589: Process.cpu_affinity() accepts any kind of iterable (set, + tuple, ...), not only lists. + + #594: all deprecated APIs were removed. + + #599: [Windows] process name() can now be determined for all + processes even when running as a limited user. + + #602: pre-commit GIT hook. + + #629: enhanced support for py.test and nose test discovery and + tests run. + + #616: [Windows] Add inet_ntop function for Windows XP. + * Bug fixes + + #428: [all UNIXes except Linux] correct handling of zombie + processes; introduced new ZombieProcess exception class. + + #512: [BSD] fix segfault in net_connections(). + + #555: [Linux] psutil.users() correctly handles ":0" as an alias + for "localhost" + + #579: [Windows] Fixed open_files() for PID>64K. + + #579: [Windows] fixed many compiler warnings. + + #585: [FreeBSD] net_connections() may raise KeyError. + + #586: [FreeBSD] cpu_affinity() segfaults on set in case an + invalid CPU number is provided. + + #593: [FreeBSD] Process().memory_maps() segfaults. + + #606: Process.parent() may swallow NoSuchProcess exceptions. + + #611: [SunOS] net_io_counters has send and received swapped + + #614: [Linux]: cpu_count(logical=False) return the number of + physical CPUs instead of physical cores. + + #618: [SunOS] swap tests fail on Solaris when run as normal user + + #628: [Linux] Process.name() truncates process name in case it + contains spaces or parentheses. +- specfile: + * location of .so files changes to subdir psutil + +------------------------------------------------------------------- +Mon Feb 2 22:16:07 UTC 2015 - michael@stroeder.com + +- Update to 2.2.1: + - Fixed #572 + ValueError: ambiguos inode with multiple PIDs references + +------------------------------------------------------------------- +Tue Jan 6 23:46:40 UTC 2015 - michael@stroeder.com + +- Update to 2.2.0: + - FreeBSD has now support for process CPU affinity + - new pstree.py and pidof.py example scripts + - C extension version mismatch in case the user messed up with psutil + installation or with sys.path is now detected at import time + - [Linux] a lot of file descriptors were left open + - [Windows] use proper encoding for psutil.Process.username() and + psutil.users(). + - [Solaris] fixed a high-priority bug which crashed psutil on import. + +------------------------------------------------------------------- +Tue Nov 18 13:55:21 UTC 2014 - toddrme2178@gmail.com + +- Update to 2.1.3 + * fix "undefined symbol: CPU_ALLOC" compilation error. + +------------------------------------------------------------------- +Tue Sep 30 10:32:34 UTC 2014 - toddrme2178@gmail.com + +- Update documentation files +- Spec file cleanups +- Update shebang fix +- Disable broken unit tests: tests don't work without root permissions +- Update dependencies. We should actually guarantee psutil and so + on are installed. +- Update urls +- Update to version 2.1.2 + * Enhancements + * #407: project moved from Google Code to Github; code moved from Mercurial + to Git. + * #492: use tox to run tests on multiple python versions. (patch by msabramo) + * #505: [Windows] distribution as wheel packages. + * #511: new examples/ps.py sample code. + * Bug fixes + * #340: [Windows] Process.get_open_files() no longer hangs. (patch by + Jeff Tang) + * #501: [Windows] disk_io_counters() may return negative values. + * #503: [Linux] in rare conditions Process exe(), open_files() and + connections() methods can raise OSError(ESRCH) instead of NoSuchProcess. + * #504: [Linux] can't build RPM packages via setup.py + * #506: [Linux] python 2.4 support was broken. + * #522: [Linux] Process.cpu_affinity() might return EINVAL. (patch by David + Daeschler) + * #529: [Windows] Process.exe() may raise unhandled WindowsError exception + for PIDs 0 and 4. (patch by Jeff Tang) + * #530: [Linux] psutil.disk_io_counters() may crash on old Linux distros + (< 2.6.5) (patch by Yaolong Huang) + * #533: [Linux] Process.memory_maps() may raise TypeError on old Linux distros. +- Update to version 2.1.1 + * Bug fixes + * #446: [Windows] fix encoding error when using net_io_counters() on Python 3. + (patch by Szigeti Gabor Niif) + * #460: [Windows] net_io_counters() wraps after 4G. + * #491: [Linux] psutil.net_connections() exceptions. (patch by Alexander Grothe) +- Update to version 2.1.0 + * Enhancements + * #387: system-wide open connections a-la netstat. + * Bug fixes + * #421: [Solaris] psutil does not compile on SunOS 5.10 (patch by Naveed + Roudsari) + * #489: [Linux] psutil.disk_partitions() return an empty list. +- Update to version 2.0.0 + * Enhancements + * #424: [Windows] installer for Python 3.X 64 bit. + * #427: number of logical and physical CPUs (psutil.cpu_count()). + * #447: psutil.wait_procs() timeout parameter is now optional. + * #452: make Process instances hashable and usable with set()s. + * #453: tests on Python < 2.7 require unittest2 module. + * #459: add a make file for running tests and other repetitive tasks (also + on Windows). + * #463: make timeout parameter of cpu_percent* functions default to 0.0 'cause + it's a common trap to introduce slowdowns. + * #468: move documentation to readthedocs.com. + * #477: process cpu_percent() is about 30% faster. (suggested by crusaderky) + * #478: [Linux] almost all APIs are about 30% faster on Python 3.X. + * #479: long deprecated psutil.error module is gone; exception classes now + live in "psutil" namespace only. + * Bug fixes + * #193: psutil.Popen constructor can throw an exception if the spawned process + terminates quickly. + * #340: [Windows] process get_open_files() no longer hangs. (patch by + jtang@vahna.net) + * #443: [Linux] fix a potential overflow issue for Process.set_cpu_affinity() + on systems with more than 64 CPUs. + * #448: [Windows] get_children() and ppid() memory leak (patch by Ulrich + Klank). + * #457: [POSIX] pid_exists() always returns True for PID 0. + * #461: namedtuples are not pickle-able. + * #466: [Linux] process exe improper null bytes handling. (patch by + Gautam Singh) + * #470: wait_procs() might not wait. (patch by crusaderky) + * #471: [Windows] process exe improper unicode handling. (patch by + alex@mroja.net) + * #473: psutil.Popen.wait() does not set returncode attribute. + * #474: [Windows] Process.cpu_percent() is no longer capped at 100%. + * #476: [Linux] encoding error for process name and cmdline. + * API changes + For the sake of consistency a lot of psutil APIs have been renamed. + In most cases accessing the old names will work but it will cause a + DeprecationWarning. + * psutil.* module level constants have being replaced by functions + * Renamed psutil.* functions + * All psutil.Process ``get_*`` methods lost the ``get_`` prefix. + get_ext_memory_info() renamed to memory_info_ex(). + Assuming "p = psutil.Process()" + * All psutil.Process ``set_*`` methods lost the ``set_`` prefix. + Assuming "p = psutil.Process()" + * Except for 'pid' all psutil.Process class properties have been turned into + methods. This is the only case which there are no aliases. + Assuming "p = psutil.Process()" + * timeout parameter of cpu_percent* functions defaults to 0.0 instead of 0.1. + * long deprecated psutil.error module is gone; exception classes now live in + "psutil" namespace only. + * Process instances' "retcode" attribute returned by psutil.wait_procs() has + been renamed to "returncode" for consistency with subprocess.Popen. + +------------------------------------------------------------------- +Wed Sep 3 01:41:38 CEST 2014 - ro@suse.de + +- sanitize release line in specfile + +------------------------------------------------------------------- +Wed Nov 27 21:26:26 UTC 2013 - p.drouand@gmail.com + +- Update to version 1.2.1 + * #348: [Windows XP] fixed "ImportError: DLL load failed" occurring + on module import. + * #425: [Solaris] crash on import due to failure at determining BOOT_TIME. + * #443: [Linux] can't set CPU affinity with systems with more than 64 cores. +- Changes from version 1.2.0 + * #439: assume os.getpid() if no argument is passed to psutil.Process + constructor. + * #440: new psutil.wait_procs() utility function which waits for multiple + processes to terminate. + * #348: [Windows XP/Vista] fixed "ImportError: DLL load failed" occurring on + module import. +- Changes from version 1.1.3 + * #442: [Linux] psutil won't compile on certain version of Linux because of + missing prlimit(2) syscall. +- Changes from version 1.1.2 + * #442: [Linux] psutil won't compile on Debian 6.0 because of missing + prlimit(2) syscall. + +------------------------------------------------------------------- +Mon Oct 21 12:19:35 UTC 2013 - dmueller@suse.com + +- update to 1.1.1: + * #410: tar.gz and windows binary files are now hosted on PYPI. + * #412: [Linux] get/set process resource limits. + * #415: [Windows] Process.get_children() is an order of magnitude faster. + * #426: [Windows] Process.name is an order of magnitude faster. + * #431: [UNIX] Process.name is slightly faster because it unnecessarily + retrieved also process cmdline. + +------------------------------------------------------------------- +Fri Jul 19 10:52:59 UTC 2013 - dmueller@suse.com + +- update to 1.0.1: + * network_io_counters(pernic=True) no longer works as intended in 1.0.0. + +------------------------------------------------------------------- +Thu Jul 11 14:27:00 UTC 2013 - dmueller@suse.com + +- update to 1.0.0: + * Process.get_connections() 'status' strings are now constants. + * test suite exits with non-zero on failure. (patch by floppymaster) + * extensively use unittest2 module in unit tests and provide + workarounds if this is not installed on python < 2.7. + * Process.get_memory_maps() may raise ValueError. + * Process.get_connections() 'status' field is no longer a string but a constant + object (psutil.CONN_*). + * Process.get_connections() 'local_address' and 'remote_address' fields renamed + to 'laddr' and 'raddr'. + * psutil.network_io_counters() renamed to psutil.net_io_counters(). + +------------------------------------------------------------------- +Tue May 7 08:31:57 UTC 2013 - michael@stroeder.com + +- Update to upstream release 0.7.1: + Many bug fixes, some new features and API changes + +------------------------------------------------------------------- +Wed Jan 2 19:44:41 UTC 2013 - toddrme2178@gmail.com + +- Fix building on SLES + +------------------------------------------------------------------- +Sat Oct 6 23:01:56 UTC 2012 - os-dev@jacraig.com + +- Update to 0.6.1: + * process cmdline property now makes a better job at guessing the process + executable from the cmdline. + * process exe was resolved in case it was a symlink. + * python 2.4 compatibility was broken. + * process exe can now return an empty string instead of raising AccessDenied. + * process exe is no longer resolved in case it's a symlink. +- Tons of changes from previous versions, please see HISTORY. +- Remove references to docs directory in spec file, as it no longer exists. +- Remove unnecessary shebangs from python scripts to quiet rpmlint. + +------------------------------------------------------------------- +Fri May 25 04:29:28 UTC 2012 - highwaystar.ru@gmail.com + +- python3 package added +- minor spec improvement + +------------------------------------------------------------------- +Tue Apr 24 07:44:19 UTC 2012 - saschpe@suse.de + +- It's not a noarch package + +------------------------------------------------------------------- +Fri Mar 23 09:44:42 UTC 2012 - saschpe@suse.de + +- Spec file cleanup: + * No need for setuptools here, distribute replaces it completely + * Macro simplifcation + +------------------------------------------------------------------- +Mon Mar 19 22:00:43 UTC 2012 - cfarrell@suse.com + +- First import + diff --git a/python-psutil.spec b/python-psutil.spec new file mode 100644 index 0000000..619d966 --- /dev/null +++ b/python-psutil.spec @@ -0,0 +1,108 @@ +# +# spec file for package python-psutil +# +# Copyright (c) 2023 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%ifarch x86_64 %{ix86} +%bcond_without test +%else +%bcond_with test +%endif +%bcond_without python2 +%{?sle15_python_module_pythons} +Name: python-psutil +Version: 5.9.5 +Release: 0 +Summary: A process utilities module for Python +License: BSD-3-Clause +URL: https://github.com/giampaolo/psutil +Source: https://files.pythonhosted.org/packages/source/p/psutil/psutil-%{version}.tar.gz +# PATCH-FIX-UPSTREAM skip_failing_tests.patch gh#giampaolo/psutil#1635 mcepl@suse.com +# skip tests failing because of incomplete emulation of the environment in osc build +Patch2: skip_failing_tests.patch +# PATCH-FIX-SLE skip_rlimit_tests_on_python2.patch alarrosa@suse.com +Patch3: skip_rlimit_tests_on_python2.patch +# PATCH-FIX-SLE adopt change of used memory of procps +Patch4: mem-used-bsc1181475.patch +# PATCH-FIX-UPSTREAM logind_y2038.patch gh#giampaolo/psutil#2300 aplanas@suse.com +Patch5: logind_y2038.patch +BuildRequires: %{python_module devel} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: procps +BuildRequires: systemd +BuildRequires: systemd-devel +%if %{with test} +BuildRequires: /usr/bin/who +BuildRequires: net-tools +BuildRequires: procps +%if %{with python2} +BuildRequires: python-ipaddress +BuildRequires: python-mock +BuildRequires: python-unittest2 +%endif +%endif +%ifpython2 +Requires: python-ipaddress +%endif +%python_subpackages + +%description +A graphical interface that lets you easily analyze and introspect unaltered running Python processes. + +%prep +%setup -q -n psutil-%{version} +%autopatch -p1 + +# Remove shebangs +sed -i "1s/#!.*//" psutil/{__init__.py,_compat.py,_psbsd.py,_pslinux.py,_psosx.py,_psposix.py,_pssunos.py,_pswindows.py} + +%build +%python_build + +%install +%python_install + +%{python_expand mkdir -p %{buildroot}%{_docdir}/%{$python_prefix}-psutil +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}|" {} \; +%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 PSUTIL_DEBUG=1 +export PYTHONDONTRWRITEBYTECODE=1 +mkdir testd +pushd testd +%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -Wa -m psutil.tests +popd +%endif + +%files %{python_files} +%license LICENSE +%doc CREDITS HISTORY.rst README.rst +%{_docdir}/%{python_prefix}-psutil/scripts/ +%{python_sitearch}/psutil/ +%exclude %{python_sitearch}/psutil/tests +%{python_sitearch}/psutil-%{version}*-info + +%changelog diff --git a/skip_failing_tests.patch b/skip_failing_tests.patch new file mode 100644 index 0000000..aae6b11 --- /dev/null +++ b/skip_failing_tests.patch @@ -0,0 +1,162 @@ +Index: psutil-5.9.5/psutil/tests/test_misc.py +=================================================================== +--- psutil-5.9.5.orig/psutil/tests/test_misc.py ++++ psutil-5.9.5/psutil/tests/test_misc.py +@@ -251,6 +251,7 @@ class TestMisc(PsutilTestCase): + + # # XXX: https://github.com/pypa/setuptools/pull/2896 + # @unittest.skipIf(APPVEYOR, "temporarily disabled due to setuptools bug") ++ # @unittest.skip("Fails in OBS") + # def test_setup_script(self): + # setup_py = os.path.join(ROOT_DIR, 'setup.py') + # if CI_TESTING and not os.path.exists(setup_py): +@@ -847,6 +848,7 @@ class TestScripts(PsutilTestCase): + src = f.read() + ast.parse(src) + ++ @unittest.skip("Fails in OBS") + def test_coverage(self): + # make sure all example scripts have a test method defined + meths = dir(self) +@@ -866,6 +868,7 @@ class TestScripts(PsutilTestCase): + if not stat.S_IXUSR & os.stat(path)[stat.ST_MODE]: + raise self.fail('%r is not executable' % path) + ++ @unittest.skip("Fails in OBS") + def test_disk_usage(self): + self.assert_stdout('disk_usage.py') + +Index: psutil-5.9.5/psutil/tests/test_linux.py +=================================================================== +--- psutil-5.9.5.orig/psutil/tests/test_linux.py ++++ psutil-5.9.5/psutil/tests/test_linux.py +@@ -713,6 +713,7 @@ class TestSystemCPUCountLogical(PsutilTe + self.assertEqual(psutil.cpu_count(logical=True), num) + + @unittest.skipIf(not which("lscpu"), "lscpu utility not available") ++ @unittest.skip("Fails in OBS") + def test_against_lscpu(self): + out = sh("lscpu -p") + num = len([x for x in out.split('\n') if not x.startswith('#')]) +@@ -756,6 +757,7 @@ class TestSystemCPUCountLogical(PsutilTe + class TestSystemCPUCountCores(PsutilTestCase): + + @unittest.skipIf(not which("lscpu"), "lscpu utility not available") ++ @unittest.skip("Fails in OBS") + def test_against_lscpu(self): + out = sh("lscpu -p") + core_ids = set() +@@ -1134,6 +1136,7 @@ class TestSystemDiskPartitions(PsutilTes + + @unittest.skipIf(not hasattr(os, 'statvfs'), "os.statvfs() not available") + @skip_on_not_implemented() ++ @unittest.skip("Fails in OBS") + def test_against_df(self): + # test psutil.disk_usage() and psutil.disk_partitions() + # against "df -a" +@@ -1308,6 +1311,7 @@ class TestSystemDiskIoCounters(PsutilTes + self.assertEqual(ret.read_count, 1) + self.assertEqual(ret.write_count, 5) + ++ @unittest.skip("Fails in OBS") + def test_emulate_use_sysfs(self): + def exists(path): + if path == '/proc/diskstats': +@@ -1351,6 +1355,7 @@ class TestRootFsDeviceFinder(PsutilTestC + finder.ask_sys_class_block() + + @unittest.skipIf(GITHUB_ACTIONS, "unsupported on GITHUB_ACTIONS") ++ @unittest.skip("Fails in OBS") + def test_comparisons(self): + finder = RootFsDeviceFinder() + self.assertIsNotNone(finder.find()) +@@ -1378,6 +1383,7 @@ class TestRootFsDeviceFinder(PsutilTestC + findmnt_value = sh("findmnt -o SOURCE -rn /") + self.assertEqual(psutil_value, findmnt_value) + ++ @unittest.skip("Fails in OBS") + def test_disk_partitions_mocked(self): + with mock.patch( + 'psutil._pslinux.cext.disk_partitions', +@@ -1676,6 +1682,8 @@ class TestSensorsBattery(PsutilTestCase) + self.assertIsNone(psutil.sensors_battery().power_plugged) + assert m.called + ++ @unittest.skipUnless(os.path.exists('/sys/class/power_supply/BAT0/energy_full'), ++ 'Missing /sys/class/power_supply/BAT0/energy_full file.') + def test_emulate_energy_full_0(self): + # Emulate a case where energy_full files returns 0. + with mock_open_content( +@@ -1683,6 +1691,8 @@ class TestSensorsBattery(PsutilTestCase) + self.assertEqual(psutil.sensors_battery().percent, 0) + assert m.called + ++ @unittest.skipUnless(os.path.exists('/sys/class/power_supply/BAT0/energy_full'), ++ 'Missing /sys/class/power_supply/BAT0/energy_full file.') + def test_emulate_energy_full_not_avail(self): + # Emulate a case where energy_full file does not exist. + # Expected fallback on /capacity. +@@ -2275,6 +2285,7 @@ class TestProcessAgainstStatus(PsutilTes + value = self.read_status_file("nonvoluntary_ctxt_switches:") + self.assertEqual(self.proc.num_ctx_switches().involuntary, value) + ++ @unittest.skip("Fails in certain OBS environments") + def test_cpu_affinity(self): + value = self.read_status_file("Cpus_allowed_list:") + if '-' in str(value): +Index: psutil-5.9.5/psutil/tests/test_posix.py +=================================================================== +--- psutil-5.9.5.orig/psutil/tests/test_posix.py ++++ psutil-5.9.5/psutil/tests/test_posix.py +@@ -413,6 +413,7 @@ class TestSystemAPIs(PsutilTestCase): + # AIX can return '-' in df output instead of numbers, e.g. for /proc + @unittest.skipIf(AIX, "unreliable on AIX") + @retry_on_failure() ++ @unittest.skip("Fails in OBS") + def test_disk_usage(self): + def df(device): + try: +Index: psutil-5.9.5/psutil/tests/test_system.py +=================================================================== +--- psutil-5.9.5.orig/psutil/tests/test_system.py ++++ psutil-5.9.5/psutil/tests/test_system.py +@@ -201,6 +201,7 @@ class TestMiscAPIs(PsutilTestCase): + self.assertLess(bt, time.time()) + + @unittest.skipIf(CI_TESTING and not psutil.users(), "unreliable on CI") ++ @unittest.skip("Fails in OBS") + def test_users(self): + users = psutil.users() + self.assertNotEqual(users, []) +@@ -586,6 +587,7 @@ class TestDiskAPIs(PsutilTestCase): + def test_disk_usage_bytes(self): + psutil.disk_usage(b'.') + ++ @unittest.skip("Fails in OBS") + def test_disk_partitions(self): + def check_ntuple(nt): + self.assertIsInstance(nt.device, str) +Index: psutil-5.9.5/psutil/tests/test_contracts.py +=================================================================== +--- psutil-5.9.5.orig/psutil/tests/test_contracts.py ++++ psutil-5.9.5/psutil/tests/test_contracts.py +@@ -251,6 +251,7 @@ class TestSystemAPITypes(PsutilTestCase) + self.assertIsInstance(k, str) + self.assert_ntuple_of_nums(v, type_=(int, long)) + ++ @unittest.skip("Fails in OBS") + def test_disk_partitions(self): + # Duplicate of test_system.py. Keep it anyway. + for disk in psutil.disk_partitions(): +Index: psutil-5.9.5/psutil/tests/test_process.py +=================================================================== +--- psutil-5.9.5.orig/psutil/tests/test_process.py ++++ psutil-5.9.5/psutil/tests/test_process.py +@@ -346,6 +346,7 @@ class TestProcess(PsutilTestCase): + + @unittest.skipIf(not HAS_IONICE, "not supported") + @unittest.skipIf(not LINUX, "linux only") ++ @unittest.skip("Unreliable in OBS") + def test_ionice_linux(self): + p = psutil.Process() + if not CI_TESTING: diff --git a/skip_rlimit_tests_on_python2.patch b/skip_rlimit_tests_on_python2.patch new file mode 100644 index 0000000..4d79277 --- /dev/null +++ b/skip_rlimit_tests_on_python2.patch @@ -0,0 +1,56 @@ +--- + psutil/tests/test_process.py | 6 ++++++ + 1 file changed, 6 insertions(+) + +Index: psutil-5.9.5/psutil/tests/test_process.py +=================================================================== +--- psutil-5.9.5.orig/psutil/tests/test_process.py ++++ psutil-5.9.5/psutil/tests/test_process.py +@@ -419,6 +419,7 @@ class TestProcess(PsutilTestCase): + p.ionice(init) + + @unittest.skipIf(not HAS_RLIMIT, "not supported") ++ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2") + def test_rlimit_get(self): + import resource + p = psutil.Process(os.getpid()) +@@ -442,6 +443,7 @@ class TestProcess(PsutilTestCase): + self.assertGreaterEqual(ret[1], -1) + + @unittest.skipIf(not HAS_RLIMIT, "not supported") ++ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2") + def test_rlimit_set(self): + p = self.spawn_psproc() + p.rlimit(psutil.RLIMIT_NOFILE, (5, 5)) +@@ -455,6 +457,7 @@ class TestProcess(PsutilTestCase): + p.rlimit(psutil.RLIMIT_NOFILE, (5, 5, 5)) + + @unittest.skipIf(not HAS_RLIMIT, "not supported") ++ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2") + def test_rlimit(self): + p = psutil.Process() + testfn = self.get_testfn() +@@ -475,6 +478,7 @@ class TestProcess(PsutilTestCase): + self.assertEqual(p.rlimit(psutil.RLIMIT_FSIZE), (soft, hard)) + + @unittest.skipIf(not HAS_RLIMIT, "not supported") ++ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2") + def test_rlimit_infinity(self): + # First set a limit, then re-set it by specifying INFINITY + # and assume we overridden the previous limit. +@@ -490,6 +494,7 @@ class TestProcess(PsutilTestCase): + self.assertEqual(p.rlimit(psutil.RLIMIT_FSIZE), (soft, hard)) + + @unittest.skipIf(not HAS_RLIMIT, "not supported") ++ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2") + def test_rlimit_infinity_value(self): + # RLIMIT_FSIZE should be RLIM_INFINITY, which will be a really + # big number on a platform with large file support. On these +@@ -1320,6 +1325,7 @@ class TestProcess(PsutilTestCase): + self.assertEqual(normcase(p.exe()), normcase(PYTHON_EXE)) + + @unittest.skipIf(not POSIX, 'POSIX only') ++ @unittest.skipIf(sys.version_info.major == 2, "not supported on python2") + def test_zombie_process(self): + def succeed_or_zombie_p_exc(fun): + try: