NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #103 most downloaded on PyPI
Cross-platform lib for process and system monitoring.
Last release 8 months ago
28 Jan 2026
Release timing varies
gaps range from 2 weeks to 7 months
Nearly every release is documented
notes for 59 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
104 releases · first in 2013
2705, [Linux], [macOS], [BSD]: Process.wait no longer uses a busy loop. It now uses pidfd_open() + poll() on Linux (requires Linux
Performance
2705, [Linux], [macOS], [BSD]: Process.wait no longer uses a busy loop. It now uses pidfd_open() + poll() on Linux (requires Linux >= 5.3 and Python >= 3.9), and kqueue() on macOS and BSD.
Bug fixes
2701, [macOS], build-fail: fix compilation error on macOS < 10.7. (patch by Sergey Fedorov)
2707, [macOS], memleak: fix potential memory leaks in error paths of Process.memory_full_info and Process.threads.
2708, [macOS]: Process.cmdline and Process.environ may fail with OSError: [Errno 0] Undefined error (from sysctl(KERN_PROCARGS2)). They now raise AccessDenied instead.
2026-01-18
Enhancements
2705_: [Linux]: `Process.wait()`_ now uses pidfd_open() + poll() for waiting, resulting in no busy loop and faster response times. Requires Linux >= 5.3 and Python >= 3.9. Falls back to traditional polling if unavailable.
2705_: [macOS], [BSD]: `Process.wait()`_ now uses kqueue() for waiting, resulting in no busy loop and faster response times.
Bug fixes
2701_, [macOS]: fix compilation error on macOS < 10.7. (patch by Sergey Fedorov)
2707_, [macOS]: fix potential memory leaks in error paths of Process.memory_full_info() and Process.threads().
2708_, [macOS]: Process.cmdline()`_ and `Process.environ()`_ may fail with OSError: [Errno 0] Undefined error (from sysctl(KERN_PROCARGS2)). They now raise `AccessDenied`_ instead.
One column per quarter.
2699, [FreeBSD], [NetBSD]: heap_info does not detect small allocations (<= 1K). In order to fix that, we now flush internal jemalloc cache before fetc
Bug fixes
2699, [FreeBSD], [NetBSD]: heap_info does not detect small allocations (<= 1K). In order to fix that, we now flush internal jemalloc cache before fetching the metrics.
2025-12-29
Bug fixes
2699_, [FreeBSD], [NetBSD]: `heap_info()`_ does not detect small allocations (<= 1K). In order to fix that, we now flush internal jemalloc cache before fetching the metrics.
1275: new heap_info and heap_trim functions, providing direct access to the platform's native C heap allocator (glibc, mimalloc, libmalloc). Useful to
New APIs
1275: new heap_info and heap_trim functions, providing direct access to the platform's native C heap allocator (glibc, mimalloc, libmalloc). Useful to create tools to detect memory leaks.
Build and packaging
2680, breaking: unit tests are no longer installed / part of the distribution. They now live under tests/ instead of psutil/tests, so import psutil.tests no longer works (it was never documented to begin with).
2403, [Linux]: publish wheels for Linux musl.
Bug fixes
2684, [FreeBSD], build-fail: compilation fails on FreeBSD 14 due to missing include.
2691, [Windows], memleak: fix memory leak in net_if_stats due to missing Py_CLEAR.
2025-12-23
Enhancements
1275_: new `heap_info()`_ and `heap_trim()`_ functions, providing direct access to the platform's native C heap allocator (glibc, mimalloc, libmalloc). Useful to create tools to detect memory leaks.
2403_, [Linux]: publish wheels for Linux musl.
2680_: unit tests are no longer installed / part of the distribution. They now live under tests/ instead of psutil/tests.
Bug fixes
2684_, [FreeBSD], [critical]: compilation fails on FreeBSD 14 due to missing include.
2691_, [Windows]: fix memory leak in `net_if_stats()`_ due to missing Py_CLEAR.
Compatibility notes
2680_: import psutil.tests no longer works (but it was never documented to begin with).
2667: enforce clang-format on all C and header files. It is now the mandatory formatting style for all C sources.
Internals
2667: enforce clang-format on all C and header files. It is now the mandatory formatting style for all C sources.
2676, 2678: replace unsafe sprintf / snprintf / sprintf_s with str_format, and strlcat / strlcpy with str_copy / str_append. Unifies string handling across platforms.
Bug fixes
2677, [Windows], critical: fix MAC address string construction in net_if_addrs (buffer overflow / misformat risk).
2679, [OpenBSD], [NetBSD], build-fail: can't build due to C syntax error.
2672, [macOS], [BSD]: increase the chances to recognize zombie processes and raise the appropriate exception (ZombieProcess).
2674, [Windows]: disk_usage could truncate values on 32-bit platforms, potentially reporting incorrect total, free, used space for drives larger than 4GB.
2675, [macOS]: Process.status incorrectly returns STATUS_RUNNING for 99% of the processes.
2025-11-02
Enhancements
2667_: enforce clang-format on all C and header files. It is now the mandatory formatting style for all C sources.
2672_, [macOS], [BSD]: increase the chances to recognize zombie processes and raise the appropriate exception (`ZombieProcess`_).
2676_, 2678_: replace unsafe sprintf / snprintf / sprintf_s calls with str_format(). Replace strlcat / strlcpy with safe str_copy / str_append. This unifies string handling across platforms and reduces unsafe usage of standard string functions, improving robustness.
Bug fixes
2674_, [Windows]: `disk_usage()`_ could truncate values on 32-bit platforms, potentially reporting incorrect total/free/used space for drives larger than 4GB.
2675_, [macOS]: `Process.status()`_ incorrectly returns "running" for 99% of the processes.
2677_, [Windows]: fix MAC address string construction in `net_if_addrs()`_. Previously, the MAC address buffer was incorrectly updated using a fixed increment and sprintf_s, which could overflow or misformat the string if the MAC length or formatting changed. Also, the final 'n' was inserted unnecessarily.
2679_, [OpenBSD], [NetBSD], [critical]: can't build due to C syntax error.
2657, breaking: stop publishing prebuilt Linux and Windows wheels for 32-bit Python. 32-bit CPython is still supported, but psutil must now be built f
Build and packaging
2657, breaking: stop publishing prebuilt Linux and Windows wheels for 32-bit Python. 32-bit CPython is still supported, but psutil must now be built from source.
2565: produce wheels for free-thread cPython 3.13 and 3.14. (patch by Lysandros Nikolaou)
Bug fixes
2658, [macOS], critical: double free() in Process.environ when it fails internally. This posed a risk of segfault.
2662, [macOS], critical: massive C code cleanup to guard against possible segfaults which were (not so) sporadically spotted on CI.
2650, [macOS]: Process.cmdline and Process.environ may incorrectly raise NoSuchProcess instead of ZombieProcess.
2025-10-25
Enhancements
2657_: stop publishing prebuilt Linux and Windows wheels for 32-bit Python. 32-bit CPython is still supported, but psutil must now be built from source. 2565_: produce wheels for free-thread cPython 3.13 and 3.14 (patch by Lysandros Nikolaou)
Bug fixes
2650_, [macOS]: `Process.cmdline()`_ and `Process.environ()`_ may incorrectly raise `NoSuchProcess`_ instead of `ZombieProcess`_.
2658_, [macOS]: double free() in `Process.environ()`_ when it fails internally. This posed a risk of segfault.
2662_, [macOS]: massive C code cleanup to guard against possible segfaults which were (not so) sporadically spotted on CI.
Compatibility notes
2657_: stop publishing prebuilt Linux and Windows wheels for 32-bit Python.
2646, [SunOS]: add CI test runner for SunOS.
Internals
2646, [SunOS]: add CI test runner for SunOS.
Dropped support
2645, [SunOS], breaking: dropped support for SunOS 10.
Bug fixes
2641, [SunOS], build-fail: cannot compile psutil from sources due to missing C include.
2357, [SunOS]: Process.cmdline does not handle spaces properly. (patch by Ben Raz)
2025-10-19
Enhancements
2645_, [SunOS]: dropped support for SunOS 10.
2646_, [SunOS]: add CI test runner for SunOS.
Bug fixes
2641_, [SunOS]: cannot compile psutil from sources due to missing C include.
2357_, [SunOS]: `Process.cmdline()`_ does not handle spaces properly. (patch by Ben Raz)
Compatibility notes
2645_: SunOS 10 is no longer supported.
2581, [Windows]: publish ARM64 wheels. (patch by Matthieu Darbois )
Build and packaging
2581, [Windows]: publish ARM64 wheels. (patch by Matthieu Darbois)
Internals
2575: introduced dprint CLI tool to format .yml and .md files.
Dropped support
2571, [FreeBSD], breaking: Dropped support for FreeBSD 8 and earlier. FreeBSD 8 was maintained from 2009 to 2013.
Bug fixes
2545, [SunOS], critical: Fix handling of MIB2_UDP_ENTRY in net_connections.
2586, [macOS], critical: fixed different places in C code which can trigger a segfault.
2610, [macOS], critical: fix cpu_freq segfault on ARM architectures.
2473, [macOS], build-fail: Fix build issue on macOS 11 and lower.
2494, [Windows]: Process.memory_maps, Process.exe and Process.open_files now properly handle UNC paths (e.g. \\??\\C:\\Windows\\Temp → C:\\Windows\\Temp). (patch by Ben Peddell)
2506, [Windows]: Windows service APIs had issues with unicode services using special characters in their name.
2514, [Linux]: Process.cwd sometimes fail with FileNotFoundError due to a race condition.
2526, [Linux]: Process.create_time now uses a monotonic clock, preventing Process.is_running from returning wrong results after system clock updates. (patch by Jonathan Kohler)
2528, [Linux]: Process.children may raise PermissionError. It will now raise AccessDenied instead.
2540, [macOS]: boot_time is off by 45 seconds (C precision issue).
2541, 2570, 2578, [Linux], [macOS], [NetBSD]: Process.create_time does not reflect system clock updates.
2542: if system clock is updated Process.children and Process.parent may not be able to return the right information.
2552, [Windows]: boot_time didn't take into account the time spent during suspend / hibernation.
2560, [Linux]: Process.memory_maps may crash with IndexError on RISCV64 due to a malformed /proc/pid/smaps file. (patch by Julien Stephan)
2604, [Linux]: virtual_memory used field does not match recent versions of free CLI utility. (patch by Isaac K. Ko)
2605, [Linux]: sensors_battery reports a negative amount for seconds left.
2607, [Windows]: WindowsService.description method may fail with ERROR_NOT_FOUND. Now it returns an empty string instead.
2025-09-17
Enhancements
2581_, [Windows]: publish ARM64 wheels. (patch by Matthieu Darbois)
2571_, [FreeBSD]: Dropped support for FreeBSD 8 and earlier. FreeBSD 8 was maintained from 2009 to 2013.
2575_: introduced dprint CLI tool to format .yml and .md files.
Bug fixes
2473_, [macOS]: Fix build issue on macOS 11 and lower.
2494_, [Windows]: All APIs dealing with paths, such as `Process.memory_maps()`_, `Process.exe()`_ and `Process.open_files()`_ does not properly handle UNC paths. Paths such as \\??\\C:\\Windows\\Temp and '\\Device\\HarddiskVolume1\\Windows\\Temp' are now converted to C:\\Windows\\Temp. (patch by Ben Peddell)
2506_, [Windows]: Windows service APIs had issues with unicode services using special characters in their name.
2514_, [Linux]: `Process.cwd()`_ sometimes fail with FileNotFoundError due to a race condition.
2526_, [Linux]: `Process.create_time()`_, which is used to univocally identify a process over time, is subject to system clock updates, and as such can lead to `Process.is_running()`_ returning a wrong result. A monotonic creation time is now used instead. (patch by Jonathan Kohler)
2528_, [Linux]: `Process.children()`_ may raise PermissionError. It will now raise `AccessDenied`_ instead.
2540_, [macOS]: `boot_time()`_ is off by 45 seconds (C precision issue).
2541_, 2570_, 2578_ [Linux], [macOS], [NetBSD]: `Process.create_time()`_ does not reflect system clock updates.
2542_: if system clock is updated `Process.children()`_ and `Process.parent()`_ may not be able to return the right information.
2545_: [Illumos]: Fix handling of MIB2_UDP_ENTRY in `net_connections()`_.
2552_, [Windows]: `boot_time()`_ didn't take into account the time spent during suspend / hibernation.
2560_, [Linux]: `Process.memory_maps()`_ may crash with IndexError on RISCV64 due to a malformed /proc/{PID}/smaps file. (patch by Julien Stephan)
2586_, [macOS], [CRITICAL]: fixed different places in C code which can trigger a segfault.
2604_, [Linux]: `virtual_memory()`_ "used" memory does not match recent versions of free CLI utility. (patch by Isaac K. Ko)
2605_, [Linux]: psutil.sensors_battery() reports a negative amount for seconds left.
2607_, [Windows]: WindowsService.description() method may fail with ERROR_NOT_FOUND. Now it returns an empty string instead.
2610:, [macOS], [CRITICAL]: fix `cpu_freq()`_ segfault on ARM architectures.
Compatibility notes
2571_: dropped support for FreeBSD 8 and earlier.
2490, breaking: remove long deprecated Process.memory_info_ex() (deprecated since 4.0.0). Use Process.memory_full_info instead.
New APIs
669, [Windows]: net_if_addrs also returns the broadcast address instead of None.
API changes
2490, breaking: remove long deprecated Process.memory_info_ex() (deprecated since 4.0.0). Use Process.memory_full_info instead.
Dropped support
2480, breaking: drop Python 2.7 support. Latest version supporting it is psutil 6.1.X (pip2 install psutil==6.1.*).
Bug fixes
2496, [Linux], critical: Avoid segfault (a cPython bug) on Process.memory_maps for processes that use hundreds of GBs of memory.
2502, [macOS]: virtual_memory now uses host_statistics64 (same as vm_stat), more accurate.
2025-02-13
Enhancements
669_, [Windows]: `net_if_addrs()`_ also returns the broadcast address instead of None.
2480_: Python 2.7 is no longer supported. Latest version supporting Python 2.7 is psutil 6.1.X. Install it with: pip2 install psutil==6.1.*.
2490_: removed long deprecated Process.memory_info_ex() method. It was deprecated in psutil 4.0.0, released 8 years ago. Substitute is Process.memory_full_info().
Bug fixes
2496_, [Linux]: Avoid segfault (a cPython bug) on Process.memory_maps() for processes that use hundreds of GBs of memory.
2502_, [macOS]: `virtual_memory()`_ now relies on host_statistics64 instead of host_statistics. This is the same approach used by vm_stat CLI tool, and should grant more accurate results.
Compatibility notes
2480_: Python 2.7 is no longer supported.
2490_: removed long deprecated Process.memory_info_ex() method.
2471: use Vulture CLI tool to detect dead code.
Internals
2471: use Vulture CLI tool to detect dead code.
Bug fixes
2418, [Linux]: fix race condition in case /proc/pid/stat does not exist, but /proc/pid does, resulting in FileNotFoundError.
2470, [Linux]: users may return "localhost" instead of the actual IP address of the user logged in.
2366, [Windows]: drastically speedup process_iter by using process "fast" create time to determine process identity.
Performance
2366, [Windows]: drastically speedup process_iter by using process "fast" create time to determine process identity.
2457, [AIX]: significantly improve the speed of Process.open_files for some edge cases.
Internals
2446: use pytest instead of unittest.
2448: add make install-sysdeps target to install the necessary system dependencies (python-dev, gcc, etc.) on all supported UNIX flavors.
2449: add make install-pydeps-test and make install-pydeps-dev targets. They can be used to install dependencies meant for running tests and for local development. They can also be installed via pip install .[test] and pip install .[dev].
2456: allow running tests via python3 -m psutil.tests even if pytest is not installed.
Bug fixes
2427, critical: psutil (segfault) on import in the free-threaded (no GIL) version of Python 3.13. (patch by Sam Gross)
2455, [Linux]: IndexError may occur when reading /proc/pid/stat and field 40 (blkio_ticks) is missing.
2460, [OpenBSD]: Process.num_fds and Process.open_files may fail with NoSuchProcess for PID 0. Instead, we now return "null" values (0 and [] respectively).
2024-10-17
Enhancements
2366_, [Windows]: drastically speedup `process_iter()`_. We now determine process unique identity by using process "fast" create time method. This will considerably speedup those apps which use `process_iter()`_ only once, e.g. to look for a process with a certain name.
2446_: use pytest instead of unittest.
2448_: add make install-sysdeps target to install the necessary system dependencies (python-dev, gcc, etc.) on all supported UNIX flavors.
2449_: add make install-pydeps-test and make install-pydeps-dev targets. They can be used to install dependencies meant for running tests and for local development. They can also be installed via pip install .[test] and pip install .[dev].
2456_: allow to run tests via python3 -m psutil.tests even if pytest module is not installed. This is useful for production environments that don't have pytest installed, but still want to be able to test psutil installation.
Bug fixes
2427_: psutil (segfault) on import in the free-threaded (no GIL) version of Python 3.13. (patch by Sam Gross)
2455_, [Linux]: IndexError may occur when reading /proc/pid/stat and field 40 (blkio_ticks) is missing.
2457_, [AIX]: significantly improve the speed of `Process.open_files()`_ for some edge cases.
2460_, [OpenBSD]: `Process.num_fds()`_ and `Process.open_files()`_ may fail with `NoSuchProcess`_ for PID 0. Instead, we now return "null" values (0 and [] respectively).
2407, breaking: rename Process.connections to Process.net_connections. Old name still works but is deprecated.
New APIs
2396: a new process_iter.cache_clear() API can be used to clear process_iter internal cache.
API changes
2109, breaking: the named tuple returned by disk_partitions no longer has the maxfile and maxpath fields (they can be very slow to retrieve on NFS).
2407, breaking: rename Process.connections to Process.net_connections. Old name still works but is deprecated.
Performance
2396, breaking: process_iter no longer preemptively checks whether PIDs have been reused, making it around 20x faster. Use Process.is_running on yielded instances instead (it also removes reused PIDs from the internal cache).
Build and packaging
2369, [Windows], build-fail: wheels failed to build. Fixed by upgrading cibuildwheel.
2375, [macOS]: provide arm64 wheels. (patch by Matthieu Darbois)
2401, Support building with free-threaded CPython 3.13. (patch by Sam Gross)
2425, [Linux]: provide aarch64 wheels. (patch by Matthieu Darbois / Ben Raz)
Internals
2366, [Windows]: log debug message when using slower process APIs.
Bug fixes
2360, [macOS], build-fail: can't compile on macOS < 10.13. (patch by Ryan Schmidt)
2362, [macOS], build-fail: can't compile on macOS 10.11. (patch by Ryan Schmidt)
2365, [macOS], build-fail: can't compile on macOS < 10.9. (patch by Ryan Schmidt)
2412, [macOS], build-fail: can't compile on macOS 10.4 PowerPC due to missing MNT_ constants.
2250, [NetBSD]: Process.cmdline sometimes fail with EBUSY for long cmdlines. Now retries up to 50 times, returning an empty list as last resort.
2254, [Linux]: offline cpus raise NotImplementedError in cpu_freq (patch by Shade Gladden)
2272: Add pickle support to psutil Exceptions.
2359, [Windows]: pid_exists disagrees with Process on whether a pid exists when ERROR_ACCESS_DENIED.
2395, [OpenBSD]: pid_exists erroneously return True if the argument is a thread ID (TID) instead of a PID (process ID).
2024-06-18
Enhancements
2109_: maxfile and maxpath fields were removed from the namedtuple returned by `disk_partitions()`_. Reason: on network filesystems (NFS) this can potentially take a very long time to complete.
2366_, [Windows]: log debug message when using slower process APIs.
2375_, [macOS]: provide arm64 wheels. (patch by Matthieu Darbois)
2396_: `process_iter()`_ no longer pre-emptively checks whether PIDs have been reused. This makes `process_iter()`_ around 20x times faster.
2396_: a new psutil.process_iter.cache_clear() API can be used the clear `process_iter()`_ internal cache.
2401_, Support building with free-threaded CPython 3.13. (patch by Sam Gross)
2407_: `Process.connections()`_ was renamed to `Process.net_connections()`_. The old name is still available, but it's deprecated (triggers a DeprecationWarning) and will be removed in the future.
2425_: [Linux]: provide aarch64 wheels. (patch by Matthieu Darbois / Ben Raz)
Bug fixes
2250_, [NetBSD]: `Process.cmdline()`_ sometimes fail with EBUSY. It usually happens for long cmdlines with lots of arguments. In this case retry getting the cmdline for up to 50 times, and return an empty list as last resort.
2254_, [Linux]: offline cpus raise NotImplementedError in cpu_freq() (patch by Shade Gladden)
2272_: Add pickle support to psutil Exceptions.
2359_, [Windows], [CRITICAL]: `pid_exists()`_ disagrees with `Process`_ on whether a pid exists when ERROR_ACCESS_DENIED.
2360_, [macOS]: can't compile on macOS < 10.13. (patch by Ryan Schmidt)
2362_, [macOS]: can't compile on macOS 10.11. (patch by Ryan Schmidt)
2365_, [macOS]: can't compile on macOS < 10.9. (patch by Ryan Schmidt)
2395_, [OpenBSD]: `pid_exists()`_ erroneously return True if the argument is a thread ID (TID) instead of a PID (process ID).
2412_, [macOS]: can't compile on macOS 10.4 PowerPC due to missing MNT_ constants.
Porting notes
Version 6.0.0 introduces some changes which affect backward compatibility:
2109_: the namedtuple returned by `disk_partitions()`_' no longer has maxfile and maxpath fields.
2396_: `process_iter()`_ no longer pre-emptively checks whether PIDs have been reused. If you want to check for PID reusage you are supposed to use `Process.is_running()`_ against the yielded `Process`_ instances. That will also automatically remove reused PIDs from `process_iter()`_ internal cache.
2407_: `Process.connections()`_ was renamed to `Process.net_connections()`_. The old name is still available, but it's deprecated (triggers a DeprecationWarning) and will be removed in the future.
2343, [FreeBSD]: filter net_connections in C instead of Python, ~4x faster. Only requested connection types are now retrieved.
Performance
2343, [FreeBSD]: filter net_connections in C instead of Python, ~4x faster. Only requested connection types are now retrieved.
2342, [NetBSD]: same as above (2343) but for NetBSD.
Internals
2349: adopted black formatting style.
Bug fixes
930, [NetBSD], critical, memleak: net_connections implementation was broken. It could either leak memory or core dump.
2345, [Linux], build-fail: fix compilation on older compiler missing NIC_DUPLEX_UNKNOWN.
2340, [NetBSD]: if process is terminated, Process.cwd will return an empty string instead of raising NoSuchProcess.
2222, [macOS]: cpu_freq now returns fixed values for min and max frequencies in all Apple Silicon chips.
2024-01-19
Enhancements
2343_, [FreeBSD]: filter `net_connections()`_ returned list in C instead of Python, and avoid to retrieve unnecessary connection types unless explicitly asked. E.g., on an IDLE system with few IPv6 connections this will run around 4 times faster. Before all connection types (TCP, UDP, UNIX) were retrieved internally, even if only a portion was returned.
2342_, [NetBSD]: same as above (#2343) but for NetBSD.
2349_: adopted black formatting style.
Bug fixes
930_, [NetBSD], [critical]: `net_connections()`_ implementation was broken. It could either leak memory or core dump.
2340_, [NetBSD]: if process is terminated, `Process.cwd()`_ will return an empty string instead of raising `NoSuchProcess`_.
2345_, [Linux]: fix compilation on older compiler missing DUPLEX_UNKNOWN.
2222_, [macOS]: cpu_freq() now returns fixed values for min and max frequencies in all Apple Silicon chips.
2324: enforce Ruff rule raw-string-in-exception, which helps providing clearer tracebacks when exceptions are raised by psutil.
Internals
2324: enforce Ruff rule raw-string-in-exception, which helps providing clearer tracebacks when exceptions are raised by psutil.
Bug fixes
2321, [Linux], [SunOS], build-fail: missing #include <unistd.h> causes an implicit declaration of close() and syscall().
2325, [PyPy], build-fail: psutil did not compile on PyPy due to missing PyErr_SetExcFromWindowsErrWithFilenameObject cPython API.
2023-12-17
Enhancements
2324_: enforce Ruff rule raw-string-in-exception, which helps providing clearer tracebacks when exceptions are raised by psutil.
Bug fixes
2325_, [PyPy]: psutil did not compile on PyPy due to missing PyErr_SetExcFromWindowsErrWithFilenameObject cPython API.
1703: cpu_percent and cpu_times_percent are now thread safe.
API changes
1703: cpu_percent and cpu_times_percent are now thread safe.
2266: if Process class is passed a very high PID, raise NoSuchProcess instead of OverflowError. (patch by Xuehai Pan)
2290: PID reuse is now preemptively checked for Process.ppid and Process.parents.
Internals
2312: use ruff linter instead of flake8 + isort.
Dropped support
2246, breaking: drop python 3.4 & 3.5 support. (patch by Matthieu Darbois)
Bug fixes
2241, [NetBSD], build-fail: can't compile On NetBSD 10.99.3/amd64. (patch by Thomas Klausner)
2195, [Linux]: no longer print exception at import time in case /proc/stat can't be read due to permission error. Redirect it to PSUTIL_DEBUG instead.
2245, [Windows]: fix var unbound error on possibly in swap_memory (patch by student_2333)
2268: bytes2human() utility function was unable to properly represent negative values.
2252, [Windows]: disk_usage fails on Python 3.12+. (patch by Matthieu Darbois)
2284, [Linux]: Process.memory_full_info may incorrectly raise ZombieProcess if it's determined via /proc/pid/smaps_rollup. Instead we now fallback on reading /proc/pid/smaps.
2287, [OpenBSD], [NetBSD]: Process.is_running erroneously return False for zombie processes, because creation time cannot be determined.
2288, [Linux]: correctly raise ZombieProcess on Process.exe, Process.cmdline and Process.memory_maps instead of returning a "null" value.
2290: differently from what stated in the doc, PID reuse is not preemptively checked for Process.nice (set), Process.ionice, (set), Process.cpu_affinity (set), Process.rlimit (set), Process.parent.
2308, [OpenBSD]: Process.threads always fail with AccessDenied (also as root).
2023-10-15
Enhancements
1703_: `cpu_percent()`_ and `cpu_times_percent()`_ are now thread safe, meaning they can be called from different threads and still return meaningful and independent results. Before, if (say) 10 threads called cpu_percent(interval=None) at the same time, only 1 thread out of 10 would get the right result.
2266_: if `Process`_ class is passed a very high PID, raise `NoSuchProcess`_ instead of OverflowError. (patch by Xuehai Pan)
2246_: drop python 3.4 & 3.5 support. (patch by Matthieu Darbois)
2290_: PID reuse is now pre-emptively checked for `Process.ppid()`_ and `Process.parents()`_.
2312_: use ruff Python linter instead of flake8 + isort. It's an order of magnitude faster + it adds a ton of new code quality checks.
Bug fixes
2195_, [Linux]: no longer print exception at import time in case /proc/stat can't be read due to permission error. Redirect it to PSUTIL_DEBUG instead.
2241_, [NetBSD]: can't compile On NetBSD 10.99.3/amd64. (patch by Thomas Klausner)
2245_, [Windows]: fix var unbound error on possibly in `swap_memory()`_ (patch by student_2333)
2268_: bytes2human() utility function was unable to properly represent negative values.
2252_, [Windows]: `disk_usage()`_ fails on Python 3.12+. (patch by Matthieu Darbois)
2284_, [Linux]: `Process.memory_full_info()`_ may incorrectly raise `ZombieProcess`_ if it's determined via /proc/pid/smaps_rollup. Instead we now fallback on reading /proc/pid/smaps.
2287_, [OpenBSD], [NetBSD]: `Process.is_running()`_ erroneously return False for zombie processes, because creation time cannot be determined.
2288_, [Linux]: correctly raise `ZombieProcess`_ on `Process.exe()`_, `Process.cmdline()`_ and `Process.memory_maps()`_ instead of returning a "null" value.
2290_: differently from what stated in the doc, PID reuse is not pre-emptively checked for `Process.nice()`_ (set), `Process.ionice()`_, (set), `Process.cpu_affinity()`_ (set), `Process.rlimit()`_ (set), `Process.parent()`_.
2308_, [OpenBSD]: `Process.threads()`_ always fail with AccessDenied (also as root).
2217: print the full traceback when a DeprecationWarning or UserWarning is raised.
API changes
2230, [OpenBSD]: net_connections rewritten from scratch: now retrieves socket.AF_UNIX socket paths, is faster, and no longer produces duplicates.
2238: Process.cwd now consistently returns "" on all platforms when the directory can't be determined.
2239, [UNIX]: for zombie processes, return the truncated Process.name (15 chars) instead of raising ZombieProcess when the full name can't be determined from Process.cmdline.
Internals
2196: in case of exception, display a cleaner error traceback by hiding the KeyError bit deriving from a missed cache hit.
2217: print the full traceback when a DeprecationWarning or UserWarning is raised.
2240, [NetBSD], [OpenBSD]: add CI testing on every commit for NetBSD and OpenBSD platforms (python 3 only).
Bug fixes
2164, [Linux], build-fail: compilation fails on kernels < 2.6.27 (e.g. CentOS 5).
2186, [FreeBSD], build-fail: compilation fails with Clang 15. (patch by Po-Chuan Hsieh)
1043, [OpenBSD] net_connections returns duplicate entries.
1915, [Linux]: 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.
2191, [Linux]: disk_partitions: do not unnecessarily read /proc/filesystems and raise AccessDenied unless user specified all=False argument.
2216, [Windows]: fix tests when running in a virtual environment (patch by Matthieu Darbois)
2225, [POSIX]: users loses precision for started field (off by 1 minute).
2229, [OpenBSD]: unable to properly recognize zombie processes. NoSuchProcess may be raised instead of ZombieProcess.
2231, [NetBSD]: available virtual_memory is higher than total.
2234, [NetBSD]: virtual_memory metrics are wrong: available and used are too high. We now match values shown by htop CLI utility.
2236, [NetBSD]: Process.num_threads and Process.threads return threads that are already terminated.
2237, [OpenBSD], [NetBSD]: Process.cwd may raise FileNotFoundError if cwd no longer exists. Return an empty string instead.
2023-04-17
Enhancements
2196_: in case of exception, display a cleaner error traceback by hiding the KeyError bit deriving from a missed cache hit.
2217_: print the full traceback when a DeprecationWarning or UserWarning is raised.
2230_, [OpenBSD]: `net_connections()`_ implementation was rewritten from scratch: - We're now able to retrieve the path of AF_UNIX sockets (before it was an empty string) - The function is faster since it no longer iterates over all processes. - No longer produces duplicate connection entries.
2238_: 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.
2239_, [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.
2240_, [NetBSD], [OpenBSD]: add CI testing on every commit for NetBSD and OpenBSD platforms (python 3 only).
Bug fixes
1043_, [OpenBSD] `net_connections()`_ returns duplicate entries.
1915_, [Linux]: 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.
2164_, [Linux]: compilation fails on kernels < 2.6.27 (e.g. CentOS 5).
2186_, [FreeBSD]: compilation fails with Clang 15. (patch by Po-Chuan Hsieh)
2191_, [Linux]: `disk_partitions()`_: do not unnecessarily read /proc/filesystems and raise `AccessDenied`_ unless user specified all=False argument.
2216_, [Windows]: fix tests when running in a virtual environment (patch by Matthieu Darbois)
2225_, [POSIX]: `users()`_ loses precision for started attribute (off by 1 minute).
2229_, [OpenBSD]: unable to properly recognize zombie processes. `NoSuchProcess`_ may be raised instead of `ZombieProcess`_.
2231_, [NetBSD]: available `virtual_memory()`_ is higher than total.
2234_, [NetBSD]: `virtual_memory()`_ metrics are wrong: available and used are too high. We now match values shown by htop CLI utility.
2236_, [NetBSD]: `Process.num_threads()`_ and `Process.threads()`_ return threads that are already terminated.
2237_, [OpenBSD], [NetBSD]: `Process.cwd()`_ may raise FileNotFoundError if cwd no longer exists. Return an empty string instead.
2102: use Limited API when building wheels with CPython 3.6+ on Linux, macOS and Windows. (patch by Matthieu Darbois )
Build and packaging
2102: use Limited API when building wheels with CPython 3.6+ on Linux, macOS and Windows. (patch by Matthieu Darbois)
Bug fixes
2156, [Linux], build-fail: compilation may fail on very old gcc compilers due to missing SPEED_UNKNOWN definition. (patch by Amir Rossert)
2010, [macOS], build-fail: on MacOS, arm64 IFM_1000_TX and IFM_1000_T are the same value, causing a build failure. (patch by Lawrence D'Anna)
2077, [Windows]: Use system-level values for virtual_memory. (patch by Daniel Widdis)
2160, [Windows]: get swap_memory percent usage from performance counters. (patch by Daniel Widdis)
2022-11-07
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)
2160_, [Windows]: Get Windows percent swap usage from performance counters. (patch by Daniel Widdis)
2040, [macOS]: provide wheels for arm64 architecture. (patch by Matthieu Darbois)
Build and packaging
2040, [macOS]: provide wheels for arm64 architecture. (patch by Matthieu Darbois)
Internals
2153, [macOS] Fix race condition in test_posix.TestProcess.test_cmdline. (patch by Matthieu Darbois)
Bug fixes
2135, [macOS], critical: Process.environ may contain garbage data. Fix out-of-bounds read around sysctl_procargs. (patch by Bernhard Urban-Forster)
2138, [Linux], build-fail: can't compile psutil on Android due to undefined ethtool_cmd_speed symbol.
2116, [macOS]: net_connections fails with RuntimeError.
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)
2022-10-18
Enhancements
2040_, [macOS]: provide wheels for arm64 architecture. (patch by Matthieu Darbois)
Bug fixes
2116_, [macOS], [critical]: `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)
2093, [FreeBSD]: pids may fail with ENOMEM. Dynamically increase the malloc() buffer size until it's big enough.
Bug fixes
2093, [FreeBSD]: 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]: virtual_memory may raise ENOMEM due to missing #include <sys/param.h> directive. (patch by Peter Jeremy)
2128, [NetBSD]: swap_memory was miscalculated. (patch by Thomas Klausner)
2022-09-04
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 <sys/param.h> directive. (patch by Peter Jeremy)
2128_, [NetBSD]: `swap_memory()`_ was miscalculated. (patch by Thomas Klausner)
2037: add flags field to net_if_stats.
New APIs
2037: add flags field to net_if_stats.
2057, [OpenBSD]: add support for cpu_freq.
Performance
2050, [Linux]: increase read(2) buffer size from 1k to 32k when reading /proc pseudo files line by line.
2107, [Linux]: Process.memory_full_info now reads /proc/pid/smaps_rollup instead of /proc/pid/smaps (5x faster).
Dropped support
1053, breaking: drop Python 2.6 support. (patches by Matthieu Darbois and Hugo van Kemenade)
Bug fixes
2048: AttributeError is raised if psutil.Error class is raised manually and passed through str.
2049, [Linux]: cpu_freq erroneously returns current value in GHz while min and max are in MHz.
2050, [Linux]: virtual_memory may raise ValueError if running in a LCX container.
2022-05-20
Enhancements
1053_: drop Python 2.6 support. (patches by Matthieu Darbois and Hugo van Kemenade)
2037_: Add additional flags to net_if_stats.
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.
1996, [BSD]: add support for MidnightBSD. (patch by Saeed Rasooli )
New platforms
1996, [BSD]: add support for MidnightBSD. (patch by Saeed Rasooli)
API changes
1992: NoSuchProcess message now specifies if the PID has been reused. Error classes now have improved __repr__ and __str__.
1999, [Linux]: disk_partitions: convert /dev/root device (an alias used on some Linux distros) to real root device path.
Performance
1851, [Linux]: cpu_freq reads from /proc/cpuinfo instead of many files in /sys fs, faster on systems with many CPUs. (patch by marxin)
Documentation
2042: rewrite HISTORY.rst to use hyperlinks pointing to psutil API doc.
Internals
2005: PSUTIL_DEBUG mode now prints file name and line number of the debug messages coming from C extension modules.
Bug fixes
1953, [Windows], critical: disk_partitions crashes due to insufficient buffer len. (patch by MaWe2019)
1965, [Windows], critical: fix "Fatal Python error: deallocating None" when calling users multiple times.
1990, [Windows], memleak: starting a WindowsService leaked a service handle.
1512, [macOS]: sometimes Process.connections will crash with EOPNOTSUPP for one connection; this is now ignored.
1598, [Windows]: disk_partitions only returns mount points on drives where it first finds one.
1874, [SunOS]: swap output error due to incorrect range.
1892, [macOS]: cpu_freq broken on Apple M1. Also, min and max are set to 0 if they can't be determined, instead of raising an exception.
1901, [macOS]: Process.open_files, Process.connections and others could randomly raise AccessDenied because the internal buffer of proc_pidinfo(PROC_PIDLISTFDS) was too small. Now dynamically increased until sufficient.
1904, [Windows]: OpenProcess fails with ERROR_SUCCESS due to GetLastError() called after sprintf(). (patch by alxchk)
1913, [Linux]: wait_procs should catch subprocess.TimeoutExpired exception.
1919, [Linux]: sensors_battery can raise TypeError on PureOS.
1921, [Windows]: swap_memory shows committed memory instead of swap.
1940, [Linux]: psutil does not handle ENAMETOOLONG when accessing process file descriptors in procfs. (patch by Nikita Radchenko)
1948: memoize_when_activated decorator is not thread-safe. (patch by Xuehai Pan)
1980, [Windows]: 32bit / WoW64 processes fails to read Process.name longer than 128 characters. (patch by PetrPospisil)
1991: process_iter is not thread safe and can raise TypeError if invoked from multiple threads.
1956, [macOS]: Process.cpu_times reports incorrect timings on M1 machines. (patch by Olivier Dormond)
2023, [Linux]: cpu_freq return order is wrong on systems with more than 9 CPUs.
2021-12-29
Enhancements
1851_, [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)
1992_: `NoSuchProcess`_ message now specifies if the PID has been reused.
1992_: error classes (`NoSuchProcess`_, `AccessDenied`_, etc.) now have a better formatted and separated __repr__ and __str__ implementations.
1996_, [BSD]: add support for MidnightBSD. (patch by Saeed Rasooli)
1999_, [Linux]: `disk_partitions()`_: convert /dev/root device (an alias used on some Linux distros) to real root device path.
2005_: PSUTIL_DEBUG mode now prints file name and line number of the debug messages coming from C extension modules.
2042_: rewrite HISTORY.rst to use hyperlinks pointing to psutil API doc.
Bug fixes
1456_, [macOS], [critical]: `cpu_freq()`_ min and max are set to 0 if can't be determined (instead of crashing).
1512_, [macOS]: sometimes `Process.connections()`_ will crash with EOPNOTSUPP for one connection; this is now ignored.
1598_, [Windows]: `disk_partitions()`_ only returns mountpoints on drives where it first finds one.
1874_, [SunOS]: swap output error due to incorrect range.
1892_, [macOS]: `cpu_freq()`_ broken on Apple M1.
1901_, [macOS]: different functions, especially `Process.open_files()`_ and `Process.connections()`_, could randomly raise `AccessDenied`_ because the internal buffer of proc_pidinfo(PROC_PIDLISTFDS) syscall was not big enough. We now dynamically increase the buffer size until it's big enough instead of giving up and raising `AccessDenied`_, which was a fallback to avoid crashing.
1904_, [Windows]: OpenProcess fails with ERROR_SUCCESS due to GetLastError() called after sprintf(). (patch by alxchk)
1913_, [Linux]: `wait_procs()`_ should catch subprocess.TimeoutExpired exception.
1919_, [Linux]: `sensors_battery()`_ can raise TypeError on PureOS.
1921_, [Windows]: `swap_memory()`_ shows committed memory instead of swap.
1940_, [Linux]: psutil does not handle ENAMETOOLONG when accessing process file descriptors in procfs. (patch by Nikita Radchenko)
1948_, [critical]: memoize_when_activated decorator is not thread-safe. (patch by Xuehai Pan)
1953_, [Windows], [critical]: `disk_partitions()`_ crashes due to insufficient buffer len. (patch by MaWe2019)
1965_, [Windows], [critical]: fix "Fatal Python error: deallocating None" when calling `users()`_ multiple times.
1980_, [Windows]: 32bit / WoW64 processes fails to read `Process.name()`_ longer than 128 characters resulting in `AccessDenied`_. This is now fixed. (patch by PetrPospisil)
1991_, [critical]: `process_iter()`_ is not thread safe and can raise TypeError if invoked from multiple threads.
1956_, [macOS]: `Process.cpu_times()`_ reports incorrect timings on M1 machines. (patch by Olivier Dormond)
2023_, [Linux]: `cpu_freq()`_ return order is wrong on systems with more than 9 CPUs.
1891, [macOS]: get rid of deprecated getpagesize().
New APIs
1863: disk_partitions exposes 2 extra fields: maxfile and maxpath, which are the maximum file name and path name length.
New platforms
1872, [Windows]: added support for PyPy 2.7.
Build and packaging
1879: provide pre-compiled wheels for Linux and macOS (yey!).
Internals
1880: switch CI from Travis/Cirrus to GitHub Actions (Linux, macOS, FreeBSD). AppVeyor still used for Windows.
Bug fixes
1708, [Linux]: get rid of sensors_temperatures duplicates. (patch by Tim Schlueter).
1839, [Windows]: always raise AccessDenied instead of WindowsError when failing to query 64 processes from 32 bit ones by using NtWoW64 APIs.
1866, [Windows]: Process.exe, Process.cmdline, Process.environ may raise "[WinError 998] Invalid access to memory location" on Python 3.9 / VS 2019.
1874, [SunOS]: 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.
1886, [macOS]: EIO error may be raised on Process.cmdline and Process.environ. Now it gets translated into AccessDenied.
1887, [Windows]: OpenProcess may fail with "[WinError 0] The operation completed successfully"." Turn it into AccessDenied or NoSuchProcess depending on whether the PID is alive.
1891, [macOS]: get rid of deprecated getpagesize().
2020-12-19
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 (yey!).
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], [critical]: always raise `AccessDenied`_ instead of WindowsError when failing to query 64 processes from 32 bit ones by using NtWoW64 APIs.
1866_, [Windows], [critical]: `Process.exe()`_, `Process.cmdline()`_, `Process.environ()`_ may raise "[WinError 998] Invalid access to memory location" on Python 3.9 / VS 2019.
1874_, [SunOS]: wrong swap output given when encrypted column is present.
1875_, [Windows], [critical]: `Process.username()`_ may raise ERROR_NONE_MAPPED if the SID has no corresponding account name. In this case `AccessDenied`_ is now raised.
1886_, [macOS]: EIO error may be raised on `Process.cmdline()`_ and `Process.environ()`_. Now it gets translated into `AccessDenied`_.
1887_, [Windows], [critical]: OpenProcess may fail with "[WinError 0] The operation completed successfully"." Turn it into `AccessDenied`_ or `NoSuchProcess`_ depending on whether the PID is alive.
1891_, [macOS]: get rid of deprecated getpagesize().
809, [FreeBSD]: add support for Process.rlimit.
New APIs
809, [FreeBSD]: add support for Process.rlimit.
893, [BSD]: add support for Process.environ (patch by Armin Gruner)
API changes
1830, [POSIX]: net_if_stats isup also checks whether the NIC is running (meaning Wi-Fi or ethernet cable is connected). (patch by Chris Burger)
1837, [Linux]: improved battery detection and charge secsleft calculation (patch by aristocratos)
Bug fixes
1823, [Windows], critical: Process.open_files may cause a segfault due to a NULL pointer.
1791, [macOS], build-fail: fix missing include for getpagesize().
1620, [Linux]: cpu_count with logical=False result is incorrect on systems with more than one CPU socket. (patch by Vincent A. Arcila)
1738, [macOS]: Process.exe may raise FileNotFoundError if process is still alive but the exe file which launched it got deleted.
1838, [Linux]: sensors_battery: if percent can be determined but not the remaining values, still return a result instead of None. (patch by aristocratos)
2020-10-23
Enhancements
809_, [FreeBSD]: add support for `Process.rlimit()`_.
893_, [BSD]: add support for `Process.environ()`_ (patch by Armin Gruner)
1830_, [POSIX]: `net_if_stats()`_ isup also checks whether the NIC is running (meaning Wi-Fi or ethernet cable is connected). (patch by Chris Burger)
1837_, [Linux]: improved battery detection and charge secsleft calculation (patch by aristocratos)
Bug fixes
1620_, [Linux]: `cpu_count()`_ with logical=False result is incorrect on systems with more than one CPU socket. (patch by Vincent A. Arcila)
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], [critical]: `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. (patch by aristocratos)
wheels for 2.7 were inadvertently deleted.
Bug fixes
wheels for 2.7 were inadvertently deleted.
1768, [Windows]: added support for Windows Nano Server. (contributed by Julien Lebot)
New platforms
1768, [Windows]: added support for Windows Nano Server. (contributed by Julien Lebot)
API changes
1747: Process.wait return value is cached so that the exit code can be retrieved on then next call.
1747, [POSIX]: Process.wait on POSIX now returns an enum, showing the negative signal which was used to terminate the process. It returns something like <Negsignal.SIGTERM: -15>.
1747: Process class provides more info about the process on str() and repr() (status and exit code).
Performance
1741, [POSIX]: make build now runs in parallel on Python >= 3.6 and it's about 15% faster.
Internals
1709: parallel tests on POSIX (make test-parallel). They're twice as fast!
1757: memory leak tests are now stable.
Bug fixes
1781, critical: getloadavg can crash the Python interpreter. (patch by Ammar Askar)
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.
2020-07-15
Enhancements
1729_: parallel tests on POSIX (make test-parallel). They're twice as fast!
1741_, [POSIX]: make build now runs in parallel on Python >= 3.6 and it's about 15% faster.
1747_: `Process.wait()`_ return value is cached so that the exit code can be retrieved on then next call.
1747_, [POSIX]: `Process.wait()`_ on POSIX now returns an enum, showing the negative signal which was used to terminate the process. It returns something like <Negsignal.SIGTERM: -15>.
1747_: `Process`_ class 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)
Bug fixes
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_, [critical]: `getloadavg()`_ can crash the Python interpreter. (patch by Ammar Askar)
1646, [FreeBSD], critical: many Process methods may cause a segfault due to a backward incompatible change in a C type on FreeBSD 12.0.
New platforms
1637, [SunOS]: add partial support for old SunOS 5.10 Update 0 to 3.
1686, [Windows]: added support for PyPy on Windows.
API changes
1648, [Linux]: sensors_temperatures looks into an additional /sys/device/ directory for additional data. (patch by Javad Karabi)
1677, [Windows]: Process.exe will succeed for all process PIDs (instead of raising AccessDenied).
1693, [Windows]: boot_time, Process.create_time and users's login time now have 1 micro second precision (before the precision was of 1 second).
Performance
1679, [Windows]: net_connections and Process.connections are 10% faster.
Internals
1671, [FreeBSD]: add CI testing/service for FreeBSD (Cirrus CI).
1682, [PyPy]: added CI / test integration for PyPy via Travis.
Dropped support
1652, [Windows], breaking: dropped support for Windows XP and Windows Server 2003. Minimum supported Windows version now is Windows Vista.
Bug fixes
1646, [FreeBSD], critical: many Process methods may cause a segfault due to a backward incompatible change in a C type on FreeBSD 12.0.
1695, [Linux], build-fail: could not compile on kernels <= 2.6.13 due to PSUTIL_HAS_IOPRIO not being defined. (patch by Anselm Kruis)
1538, [NetBSD]: Process.cwd may return ENOENT instead of NoSuchProcess.
1627, [Linux]: Process.memory_maps can raise KeyError.
1642, [SunOS]: querying basic info for PID 0 results in FileNotFoundError.
1656, [Windows]: Process.memory_full_info raises AccessDenied even for the current user and os.getpid.
1660, [Windows]: Process.open_files rewritten with proper error handling.
1662, [Windows]: Process.exe may raise "[WinError 0] The operation completed successfully".
1665, [Linux]: disk_io_counters does not take into account extra fields added to recent kernels. (patch by Mike Hommey)
1672: use the right C type when dealing with PIDs (int or long).
1673, [OpenBSD]: Process.connections, Process.num_fds and Process.threads raised wrong exception if process is gone.
1674, [SunOS]: disk_partitions may raise OSError.
1684, [Linux]: disk_io_counters may raise ValueError on systems not having /proc/diskstats.
2020-02-18
Enhancements
1637_, [SunOS]: add partial support for old SunOS 5.10 Update 0 to 3.
1648_, [Linux]: `sensors_temperatures()`_ looks into an additional /sys/device/ directory for additional data. (patch by Javad Karabi)
1652_, [Windows]: dropped support for Windows XP and Windows Server 2003. Minimum supported Windows version now is Windows Vista.
1671_, [FreeBSD]: add CI testing/service for FreeBSD (Cirrus CI).
1677_, [Windows]: `Process.exe()`_ will succeed for all process PIDs (instead of raising `AccessDenied`_).
1679_, [Windows]: `net_connections()`_ and `Process.connections()`_ are 10% faster.
1682_, [PyPy]: added CI / test integration for PyPy via Travis.
1686_, [Windows]: added support for PyPy on Windows.
1693_, [Windows]: `boot_time()`_, `Process.create_time()`_ and `users()`_'s login time now have 1 micro second precision (before the precision was of 1 second).
Bug fixes
1538_, [NetBSD]: `Process.cwd()`_ may return ENOENT instead of `NoSuchProcess`_.
1627_, [Linux]: `Process.memory_maps()`_ can raise KeyError.
1642_, [SunOS]: querying basic info for PID 0 results in FileNotFoundError.
1646_, [FreeBSD], [critical]: many `Process`_ methods may cause a segfault due to a backward incompatible change in a C type on FreeBSD 12.0.
1656_, [Windows]: `Process.memory_full_info()`_ raises `AccessDenied`_ even for the current user and os.getpid().
1660_, [Windows]: `Process.open_files()`_ complete rewrite + check of errors.
1662_, [Windows], [critical]: `Process.exe()`_ may raise "[WinError 0] The operation completed successfully".
1665_, [Linux]: `disk_io_counters()`_ does not take into account extra fields added to recent kernels. (patch by Mike Hommey)
1672_: use the right C type when dealing with PIDs (int or long). Thus far (long) was almost always assumed, which is wrong on most platforms.
1673_, [OpenBSD]: `Process.connections()`_, `Process.num_fds()`_ and `Process.threads()`_ returned improper exception if process is gone.
1674_, [SunOS]: `disk_partitions()`_ may raise OSError.
1684_, [Linux]: `disk_io_counters()`_ may raise ValueError on systems not having /proc/diskstats.
1695_, [Linux]: could not compile on kernels <= 2.6.13 due to PSUTIL_HAS_IOPRIO not being defined. (patch by Anselm Kruis)
1630, [Windows], build-fail: can't compile source distribution due to C syntax error.
Bug fixes
1630, [Windows], build-fail: can't compile source distribution due to C syntax error.
2019-11-26
Bug fixes
1630_, [Windows], [critical]: can't compile source distribution due to C syntax error.
1616, critical: use of Py_DECREF instead of Py_CLEAR will result in double free() and segfault (CVE-2019-18874 __). (patch by Riccardo Schirone)
Bug fixes
1616, critical: use of Py_DECREF instead of Py_CLEAR will result in double free() and segfault (CVE-2019-18874). (patch by Riccardo Schirone)
1619, [OpenBSD], build-fail: compilation fails due to C syntax error. (patch by Nathan Houghton)
1179, [Linux]: Process.cmdline now handles processes that use inappropriate chars to separate args.
2019-11-25
Bug fixes
1179_, [Linux]: `Process.cmdline()`_ now takes into account misbehaving processes renaming the command line and using inappropriate chars to separate args.
1616_, [critical]: use of Py_DECREF instead of Py_CLEAR will result in double free() and segfault (CVE-2019-18874). (patch by Riccardo Schirone)
1619_, [OpenBSD], [critical]: compilation fails due to C syntax error. (patch by Nathan Houghton)
1615, build-fail: remove pyproject.toml as it was causing installation issues.
Bug fixes
1615, build-fail: remove pyproject.toml as it was causing installation issues.
2019-11-06
Bug fixes
1615_: remove pyproject.toml as it was causing installation issues.
1527, [Linux]: added Process.cpu_times iowait counter, which is the time spent waiting for blocking I/O to complete.
New APIs
1527, [Linux]: added Process.cpu_times iowait counter, which is the time spent waiting for blocking I/O to complete.
Build and packaging
1565: add PEP 517/8 build backend and requirements specification for better pip integration. (patch by Bernát Gábor)
Bug fixes
1126, [Linux], critical: Process.cpu_affinity segfaults on CentOS 5 / manylinux. Process.cpu_affinity support for CentOS 5 was removed.
1528, [AIX], build-fail: compilation error on AIX 7.2 due to 32 vs 64 bit differences. (patch by Arnon Yaari)
1606, [SunOS], build-fail: compilation fails on SunOS 5.10. (patch by vser1)
875, [Windows]: Process.cmdline, Process.environ or Process.cwd may occasionally fail with ERROR_PARTIAL_COPY which now gets translated to AccessDenied.
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, [macOS]: avoid calling close() (in C) on possible negative integers. (patch by Athos Ribeiro)
2019-11-04
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], [critical]: `Process.cmdline()`_, `Process.environ()`_ or `Process.cwd()`_ may occasionally fail with ERROR_PARTIAL_COPY which now gets translated to `AccessDenied`_.
1126_, [Linux], [critical]: `Process.cpu_affinity()`_ segfaults on CentOS 5 / manylinux. `Process.cpu_affinity()`_ support for CentOS 5 was removed.
1528_, [AIX], [critical]: 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]: avoid calling close() (in C) on possible negative integers. (patch by Athos Ribeiro)
1606_, [SunOS], [critical]: compilation fails on SunOS 5.10. (patch by vser1)
1494, [AIX]: added support for Process.environ. (patch by Arnon Yaari )
New APIs
1494, [AIX]: added support for Process.environ. (patch by Arnon Yaari)
Bug fixes
1276, [AIX]: can't get whole Process.cmdline. (patch by Arnon Yaari)
1501, [Windows]: Process.cmdline and Process.exe raise unhandled "WinError 1168 element not found" exceptions for "Registry" and "Memory Compression" pseudo processes on Windows 10.
1526, [NetBSD]: Process.cmdline could raise MemoryError. (patch by Kamil Rytarowski)
2019-06-11
Enhancements
1494_, [AIX]: added support for `Process.environ()`_. (patch by Arnon Yaari)
Bug fixes
1276_, [AIX]: can't get whole `Process.cmdline()`_. (patch by Arnon Yaari)
1501_, [Windows]: `Process.cmdline()`_ and `Process.exe()`_ raise unhandled "WinError 1168 element not found" exceptions for "Registry" and "Memory Compression" pseudo processes on Windows 10.
1526_, [NetBSD], [critical]: `Process.cmdline()`_ could raise MemoryError. (patch by Kamil Rytarowski)
604, [Windows]: add new getloadavg, returning system load average calculation, including on Windows (emulated). (patch by Ammar Askar )
New APIs
604, [Windows]: add new getloadavg, returning system load average calculation, including on Windows (emulated). (patch by Ammar Askar)
1476, [Windows]: Process.ionice can now set high I/O priority. New constants: IOPRIO_VERYLOW, IOPRIO_LOW, IOPRIO_NORMAL, IOPRIO_HIGH.
API changes
1404, [Linux]: cpu_count with logical=False falls back to reading /sys/devices/system/cpu/*/topology/core_id if /proc/cpuinfo doesn't provide the info.
Documentation
1464: various docfixes (always point to Python 3 doc, fix links, etc.).
Internals
1458: provide coloured test output. Also show failures on KeyboardInterrupt.
1478: add make command to re-run tests failed on last run.
1462, [Linux]: (tests) make tests invariant to LANG setting (patch by Benjamin Drung)
1463: scripts/cpu_distribution.py was broken.
Bug fixes
1480, [Windows], critical: cpu_count with logical=False could cause a crash due to fixed read violation. (patch by Samer Masterson)
1491, [SunOS], memleak: net_if_addrs: use free() against ifap struct on error. (patch by Agnewee)
1223, [Windows]: boot_time may return incorrect value on Windows XP.
1456, [Linux]: cpu_freq returns None instead of 0.0 when min and max fields can't be determined. (patch by Alex Manuskin)
1470, [Linux]: disk_partitions: fix corner case when /etc/mtab doesn't exist. (patch by Cedric Lamoriniere)
1471, [SunOS]: Process.name and Process.cmdline can return SystemError. (patch by Daniel Beer)
1472, [Linux]: cpu_freq does not return all CPUs on Raspberry-pi 3.
1474: fix formatting of psutil.tests() which mimics ps aux output.
1475, [Windows]: OSError.winerror attribute wasn't properly checked resulting in WindowsError(ERROR_ACCESS_DENIED) being raised instead of AccessDenied.
1477, [Windows]: wrong or absent error handling for private NTSTATUS Windows APIs. Different process methods were affected by this.
1486, [AIX], [SunOS]: AttributeError when interacting with Process methods involved into Process.oneshot context.
1493, [Linux]: cpu_freq: handle the case where /sys/devices/system/cpu/cpufreq/ exists but it's empty.
2019-04-26
Enhancements
604_, [Windows]: add new `getloadavg()`_, returning system load average calculation, including on Windows (emulated). (patch by Ammar Askar)
1404_, [Linux]: `cpu_count()`_ with 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 CPU cores 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 Python 3 doc, fix links, etc.).
1476_, [Windows]: it is now possible to set process high I/O priority (`Process.ionice()`_). Also, I/O priority values are now exposed as 4 new constants: IOPRIO_VERYLOW, IOPRIO_LOW, IOPRIO_NORMAL, IOPRIO_HIGH.
1478_: add make command to re-run tests failed on last run.
Bug fixes
1223_, [Windows]: `boot_time()`_ may return incorrect value on Windows XP.
1456_, [Linux]: `cpu_freq()`_ returns None instead of 0.0 when min and max fields can't be determined. (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)
1471_, [SunOS]: `Process.name()`_ and `Process.cmdline()`_ can return SystemError. (patch by Daniel Beer)
1472_, [Linux]: `cpu_freq()`_ does not return all CPUs on Raspberry-pi 3.
1474_: fix formatting of psutil.tests() which mimics ps aux output.
1475_, [Windows], [critical]: OSError.winerror attribute wasn't properly checked resulting in WindowsError(ERROR_ACCESS_DENIED) being raised instead of `AccessDenied`_.
1477_, [Windows]: wrong or absent error handling for private NTSTATUS Windows APIs. Different process methods were affected by this.
1480_, [Windows], [critical]: `cpu_count()`_ with logical=False could cause a crash due to fixed read violation. (patch by Samer Masterson)
1486_, [AIX], [SunOS]: AttributeError when interacting with `Process`_ methods involved into `Process.oneshot()`_ context.
1491_, [SunOS]: `net_if_addrs()`_: use free() against ifap struct on error. (patch by Agnewee)
1493_, [Linux]: `cpu_freq()`_: handle the case where /sys/devices/system/cpu/cpufreq/ exists but it's empty.
1448, [Windows], critical: crash on import due to rtlIpv6AddressToStringA not available on Wine.
Bug fixes
1448, [Windows], critical: crash on import due to rtlIpv6AddressToStringA not available on Wine.
1451, [Windows], critical: Process.memory_full_info segfaults. NtQueryVirtualMemory is now used instead of QueryWorkingSet to calculate USS memory.
1329, [AIX], build-fail: psutil doesn't compile on AIX 6.1. (patch by Arnon Yaari)
2019-03-11
Bug fixes
1329_, [AIX]: psutil doesn't compile on AIX 6.1. (patch by Arnon Yaari)
1448_, [Windows], [critical]: crash on import due to rtlIpv6AddressToStringA not available on Wine.
1451_, [Windows], [critical]: `Process.memory_full_info()`_ segfaults. NtQueryVirtualMemory is now used instead of QueryWorkingSet to calculate USS memory.
1433: new Process.parents method. (idea by Ghislain Le Meur)
New APIs
1433: new Process.parents method. (idea by Ghislain Le Meur)
API changes
1291, [macOS], critical, breaking: Process.memory_maps was removed because inherently broken (segfault) for years.
1420, [Windows]: in case of exception disk_usage now also shows the path name.
1437: pids are returned in sorted order.
Performance
1379, [Windows]: Process.suspend and Process.resume now use NtSuspendProcess / NtResumeProcess instead of stopping / resuming all threads. Faster and more reliable.
1422, [Windows]: DLL-loaded Windows APIs are now loaded once on startup instead of per function call, significantly faster.
1426, [Windows]: PAGESIZE and number of processors is now calculated on startup.
Internals
1428: in case of error, the traceback message now shows the underlying C function called which failed.
1442: Python 3 is now the default interpreter used by Makefile.
Bug fixes
1411, [BSD], critical, memleak: lack of Py_DECREF could cause segmentation fault on process instantiation.
1353: process_iter is now thread safe (it rarely raised TypeError).
1394, [Windows]: Process.name and Process.exe may erroneously return "Registry" or fail with "[Error 0] The operation completed successfully". QueryFullProcessImageNameW is now used instead of GetProcessImageFileNameW in order to prevent that.
1419, [Windows]: Process.environ raises NotImplementedError when querying a 64-bit process in 32-bit-WoW mode. Now it raises AccessDenied.
1427, [macOS]: Process.cmdline and Process.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 Process.oneshot.
1447: original exception wasn't turned into NoSuchProcess / AccessDenied exceptions when using Process.oneshot context manager.
2019-03-05
Enhancements
1379_, [Windows]: `Process.suspend()`_ and `Process.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_: Python 3 is now the default interpreter used by Makefile.
Bug fixes
1353_: `process_iter()`_ is now thread safe (it rarely raised TypeError).
1394_, [Windows], [critical]: `Process.name()`_ and `Process.exe()`_ may erroneously return "Registry" or fail with "[Error 0] The operation completed successfully". 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 `Process.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 `Process.oneshot()`_.
1447_: original exception wasn't turned into `NoSuchProcess`_ / `AccessDenied`_ exceptions when using `Process.oneshot()`_ context manager.
Incompatible API changes
1291_, [OSX], [critical]: `Process.memory_maps()`_ was removed because inherently broken (segfault) for years.
1384, [Windows]: on Windows >= 8.1, Process.cmdline falls back to NtQueryInformationProcess on ERROR_ACCESS_DENIED. (patch by EccoTheFlintstone)
API changes
1384, [Windows]: on Windows >= 8.1, Process.cmdline falls back to NtQueryInformationProcess on ERROR_ACCESS_DENIED. (patch by EccoTheFlintstone)
Bug fixes
1408, [AIX], build-fail: psutil won't compile on AIX 7.1 due to missing header. (patch by Arnon Yaari)
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.
2019-02-15
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], [critical]: psutil won't compile on AIX 7.1 due to missing header. (patch by Arnon Yaari)
1350, [FreeBSD]: added support for sensors_temperatures. (patch by Alex Manuskin)
New APIs
1350, [FreeBSD]: added support for sensors_temperatures. (patch by Alex Manuskin)
1352, [FreeBSD]: added support for cpu_freq. (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 Process.io_counters methods are no longer exposed if not supported by the kernel.
1368, [Windows]: fix 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 where possible, reducing AccessDenied for system processes.
1376, [Windows]: check if variable is NULL before free() ing it. (patch by EccoTheFlintstone)
2019-01-23
Enhancements
1350_, [FreeBSD]: added support for `sensors_temperatures()`_. (patch by Alex Manuskin)
1352_, [FreeBSD]: added support for `cpu_freq()`_. (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 `Process.io_counters()`_ methods are no longer exposed if not supported by the kernel.
1368_, [Windows]: fix `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_, [critical]: 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)
1197, [Linux]: cpu_freq falls back to /proc/cpuinfo if /sys/devices/system/cpu/* is not available.
API changes
1197, [Linux]: cpu_freq falls back to /proc/cpuinfo if /sys/devices/system/cpu/* is not available.
1310, [Linux]: sensors_temperatures falls back to /sys/class/thermal if /sys/class/hwmon is not available (e.g. Raspberry Pi). (patch by Alex Manuskin)
Build and packaging
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, [macOS]: available and used memory (virtual_memory) metrics are not accurate.
1294, [Windows]: 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 (cpu_times) were being reported with ticks unit as opposed to seconds. (patch by Jaime Fullaondo)
1332, [macOS]: 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)
2018-10-30
Enhancements
1197_, [Linux]: `cpu_freq()`_ is now implemented by parsing /proc/cpuinfo in case /sys/devices/system/cpu/* filesystem is not available.
1310_, [Linux]: `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 (`virtual_memory()`_) metrics are not accurate.
1294_, [Windows]: `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 (`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)
1286, [macOS]: OSX constant is now deprecated in favor of new MACOS.
New APIs
1309, [Linux]: added STATUS_PARKED constant for Process.status.
API changes
1286, [macOS]: OSX constant is now deprecated in favor of new MACOS.
1321, [Linux]: disk_io_counters falls back to /sys/block if /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]: Process.connections may sometime fail with MemoryError. (patch by sylvainduchesne)
1305, [Linux]: disk_io_counters 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 values due to counting base disk device and its partition(s) twice.
1323, [Linux]: sensors_temperatures may fail with ValueError.
2018-08-14
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]: `Process.connections()`_ may sometime fail with MemoryError. (patch by sylvainduchesne)
1305_, [Linux]: `disk_io_counters()`_ 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 values due to counting base disk device and its partition(s) twice.
1323_, [Linux]: `sensors_temperatures()`_ may fail with ValueError.
1273: net_if_addrs named tuple's name has been renamed from snic to snicaddr.
API changes
1273: net_if_addrs named tuple's name has been renamed from snic to snicaddr.
Bug fixes
1258, [Windows], critical: Process.username may cause a segfault (Python interpreter crash). (patch by Jean-Luc Migot)
1274, [Linux]: there was a small chance Process.children may swallow AccessDenied exceptions.
2018-06-07
Bug fixes
1258_, [Windows], [critical]: `Process.username()`_ may cause a segfault (Python interpreter crash). (patch by Jean-Luc Migot)
1273_: `net_if_addrs()`_ namedtuple's name has been renamed from snic to snicaddr.
1274_, [Linux]: there was a small chance `Process.children()`_ may swallow `AccessDenied`_ exceptions.
1268: setup.py's extra_require parameter requires latest setuptools version, breaking quite a lot of installations.
Bug fixes
1268: setup.py's extra_require parameter requires latest setuptools version, breaking quite a lot of installations.
2018-04-14
Bug fixes
1268_: setup.py's extra_require parameter requires latest setuptools version, breaking quite a lot of installations.
1239, [Linux]: expose kernel slab memory field for virtual_memory. (patch by Maxime Mouial )
New APIs
1239, [Linux]: expose kernel slab memory field for virtual_memory. (patch by Maxime Mouial)
API changes
771, [Windows], breaking: cpu_count with logical=False on Windows XP and Vista is no longer supported and returns None.
Bug fixes
1194, [SunOS], critical: fix double free() in Process.cpu_num. (patch by Georg Sauthoff)
694, [SunOS]: Process.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 cores) return a wrong (smaller) number on systems using process groups (> 64 cores).
771, [Windows]: cpu_times with 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 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, [Windows]: fix compatibility with Python 2.6 (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)
775, [Windows]: disk_partitions return mount points.
API changes
775, [Windows]: disk_partitions return mount points.
Bug fixes
1190, [macOS]: pids may return False on macOS.
2018-01-01
Enhancements
775_: `disk_partitions()`_ on Windows return mount points.
Bug fixes
1193_: `pids()`_ may return False on macOS.
1188: Process.memory_info_ex() now warns with FutureWarning instead of DeprecationWarning.
New APIs
1173: add PSUTIL_DEBUG environment variable to print debug messages on stderr.
1177, [macOS]: added support for sensors_battery. (patch by Arnon Yaari)
API changes
1188: Process.memory_info_ex() now warns with FutureWarning instead of DeprecationWarning.
Performance
1183: Process.children is 2x faster on POSIX and 2.4x faster on Linux.
Internals
1172, [Windows]: make test does not work.
Bug fixes
1152, [Windows]: disk_io_counters may return an empty dict.
1169, [Linux]: users hostname returns username instead. (patch by janderbrain)
1179, [Linux]: Process.cmdline can now split args for processes that overwrite /proc/pid/cmdline with spaces instead of null bytes.
1181, [macOS]: Process.memory_maps may raise ENOENT.
1187, [macOS]: pids does not return PID 0 on recent macOS versions.
2017-12-07
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_, [macOS]: added support for `sensors_battery()`_. (patch by Arnon Yaari)
1183_: `Process.children()`_ is 2x faster on POSIX 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 split cmdline args for misbehaving processes which overwrite /proc/pid/cmdline and use spaces instead of null bytes as args separator.
1181_, [macOS]: `Process.memory_maps()`_ may raise ENOENT.
1187_, [macOS]: `pids()`_ does not return PID 0 on recent macOS versions.
1164, [AIX]: add support for Process.num_ctx_switches. (patch by Arnon Yaari)
New APIs
1164, [AIX]: add support for Process.num_ctx_switches. (patch by Arnon Yaari)
Internals
1151: python -m psutil.tests fail.
Dropped support
1053, breaking: drop Python 3.3 support (psutil still works but it's no longer tested).
Bug fixes
1154, [AIX], build-fail: psutil won't compile on AIX 6.1.0. (patch by Arnon Yaari)
1150, [Windows]: when a process is terminated now the exit code is set to SIGTERM instead of 0. (patch by Akos Kiss)
1167, [Windows]: net_io_counters packets count now include also non-unicast packets. (patch by Matthew Long)
2017-11-08
Enhancements
1164_, [AIX]: add support for `Process.num_ctx_switches()`_. (patch by Arnon Yaari)
1053_: drop Python 3.3 support (psutil still works but it's no longer tested).
Bug fixes
1150_, [Windows]: when a process is terminated now the exit code is set to SIGTERM instead of 0. (patch by Akos Kiss)
1151_: python -m psutil.tests fail.
1154_, [AIX], [critical]: psutil won't compile on AIX 6.1.0. (patch by Arnon Yaari)
1167_, [Windows]: `net_io_counters()`_ packets count now include also non-unicast packets. (patch by Matthew Long)
1123, [AIX]: added support for AIX platform. (patch by Arnon Yaari )
New platforms
1123, [AIX]: added support for AIX platform. (patch by Arnon Yaari)
Bug fixes
1127, [macOS], critical: invalid reference counting in Process.open_files may lead to segfault. (patch by Jakub Bacic)
1133, [Windows], build-fail: can't compile on newer versions of Visual Studio 2017 15.4. (patch by Max Bélanger)
1138, [Linux], build-fail: can't compile on CentOS 5.0 and RedHat 5.0. (patch by Prodesire)
1009, [Linux]: sensors_temperatures may crash with IOError.
1012, [Windows]: disk_io_counters read_time and write_time were expressed in tens of micro seconds instead of milliseconds.
1129, [Linux]: sensors_fans may crash with IOError. (patch by Sebastian Saip)
1131, [SunOS]: fix compilation warnings. (patch by Arnon Yaari)
2017-10-12
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()`_ read_time and write_time were expressed in tens of micro seconds instead of milliseconds.
1127_, [macOS], [critical]: 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)
1120, [Windows], breaking: .exe files are no longer uploaded on PyPI as per PEP-527. Only wheels are provided.
Build and packaging
1120, [Windows], breaking: .exe files are no longer uploaded on PyPI as per PEP-527. Only wheels are provided.
Documentation
1124: documentation moved to http://psutil.readthedocs.io
Bug fixes
1105, [FreeBSD], build-fail: psutil does not compile on FreeBSD 12.
1125, [BSD]: net_connections raises TypeError.
2017-09-10
Enhancements
1124_: documentation moved to http://psutil.readthedocs.io
Bug 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.
802: disk_io_counters and net_io_counters no longer wrap (restart from 0). New *nowrap* argument.
New APIs
802: disk_io_counters and net_io_counters no longer wrap (restart from 0). New nowrap argument.
1022: users provides a new pid field.
1025: process_iter accepts new attrs and ad_value parameters to invoke Process.as_dict inline.
1051: disk_usage on Python 3 is now able to accept bytes.
1091, [SunOS]: implemented Process.environ. (patch by Oleksii Shevchuk)
API changes
1039, breaking: returned types consolidation. 1) Windows / Process.cpu_times: fields #3 and #4 were int instead of float. 2) Linux / FreeBSD / OpenBSD: Process.connections raddr is now set to "" instead of None when retrieving UNIX sockets.
1040, breaking: all strings are encoded by using OS fs encoding.
1040, breaking: the following Windows APIs on Python 2 now return a string instead of unicode: Process.memory_maps's path field, WindowsService.binpath, WindowsService.description, WindowsService.display_name, WindowsService.username.
928: net_connections and Process.connections laddr and raddr are now named tuples.
1015: swap_memory now reads /proc/meminfo instead of sysinfo() syscall, so it works with PROCFS_PATH for containers.
1040: implemented full unicode support.
1079, [FreeBSD]: net_connections fd number is now being set for real (instead of -1). (patch by Gleb Smirnoff)
Build and packaging
1060: source distribution now only includes relevant files.
Internals
1058: test suite now enables all warnings by default.
Bug fixes
1064, [NetBSD], critical: swap_memory may segfault in case of error.
1042, [FreeBSD], build-fail: psutil won't compile on FreeBSD 12.
1033, [macOS], [FreeBSD], memleak: memory leak for net_connections and Process.connections when retrieving UNIX sockets (kind='unix').
1047, [Windows], memleak: Process.username: memory leak in case exception is thrown.
1050, [Windows], memleak: Process.memory_maps leaks memory.
1067, [NetBSD], memleak: Process.cmdline leaks memory if process has terminated.
1068, [OpenBSD], memleak: net_connections leaks memory if sysctl() fails.
989, [Windows]: boot_time may return a negative value.
1007, [Windows]: boot_time can have a 1 sec fluctuation between calls. The first call value is now cached.
1013, [FreeBSD]: 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]: Process.open_files may erroneously raise NoSuchProcess instead of skipping a file which gets deleted while open files are retrieved.
1029, [macOS], [FreeBSD]: Process.connections with family=unix on Python 3 doesn't properly handle unicode paths and may raise UnicodeDecodeError.
1040: fixed many unicode related issues such as UnicodeDecodeError on Python 3 + POSIX and invalid encoded data on Windows.
1044, [macOS]: different Process methods incorrectly raise AccessDenied for zombie processes.
1046, [Windows]: disk_partitions on Windows overrides user's SetErrorMode.
1048, [Windows]: users's host field report an invalid IP address.
1055: cpu_count is no longer cached (CPUs can be disabled at runtime on Linux). Process.cpu_percent also affected.
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.
1065, [OpenBSD]: Process.cmdline may raise SystemError.
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]: Process.memory_maps shows wrong 64 bit addresses.
1094, [Windows]: fix pid_exists returning wrong result. All OpenProcess APIs now verify 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.
2017-09-01
Enhancements
802_: `disk_io_counters()`_ and `net_io_counters()`_ numbers no longer wrap (restart from 0). Introduced a new nowrap argument.
928_: `net_connections()`_ and `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_: `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 these 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()`_ 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]: `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]: `Process.open_files()`_ may erroneously raise `NoSuchProcess`_ instead of skipping a file which gets deleted while open files are retrieved.
1029_, [macOS], [FreeBSD]: `Process.connections()`_ with family=unix on Python 3 doesn't properly handle unicode paths and may raise UnicodeDecodeError.
1033_, [macOS], [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 + POSIX and invalid encoded data on Windows.
1042_, [FreeBSD], [critical]: psutil won't compile on FreeBSD 12.
1044_, [macOS]: 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()`_ host field report an invalid IP address.
1050_, [Windows]: `Process.memory_maps()`_ 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], [critical]: `swap_memory()`_ may segfault in case of error.
1065_, [OpenBSD], [critical]: `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]: `Process.memory_maps()`_ shows wrong 64 bit addresses.
1094_, [Windows]: `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. 1) Windows / `Process.cpu_times()`_: fields #3 and #4 were int instead of float. 2) Linux / FreeBSD / OpenBSD: `Process.connections()`_ raddr is now set to "" instead of None when retrieving UNIX sockets.
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().
1000: fixed some setup.py warnings.
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. Let's not make the function available 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.
Bug fixes
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.
974, [Linux]: Add sensors_fans function. (patch by Nicolas Hennion )
New APIs
974, [Linux]: Add 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
985, [Windows], critical: Fix a crash in Process.open_files when the worker thread for NtQueryObject times out.
872, [Linux], build-fail: can now compile on Linux by using MUSL C library.
986, [Linux]: Process.cwd may raise NoSuchProcess instead of ZombieProcess.
2017-03-05
Enhancements
971_, [Linux]: Add `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`_.
971, [Linux]: sensors_temperatures didn't work on CentOS 7.
Bug fixes
971, [Linux]: sensors_temperatures didn't work on CentOS 7.
973: cpu_percent may raise ZeroDivisionError.
Bug fixes
971_, [Linux]: `sensors_temperatures()`_ didn't work on CentOS 7.
973_, [critical]: `cpu_percent()`_ may raise ZeroDivisionError.
966, [Linux]: sensors_battery power_plugged may erroneously return None on Python 3.
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 name and label fields on Python 3 are bytes instead of str.
966, [Linux]: sensors_battery percent is a float and is more precise.
API changes
966, [Linux]: sensors_battery percent is a float and is more precise.
Bug fixes
964, [Windows]: Process.username and users may return badly decoded 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 FileNotFoundError.
966, [Linux]: sensors_battery power_plugged may lie.
357: added Process.cpu_num (what CPU a process is on).
New APIs
357: added Process.cpu_num (what CPU a process is on).
371, [Linux]: added sensors_temperatures.
941: added cpu_freq (CPU frequency).
955, [Linux], [Windows]: added sensors_battery.
956: Process.cpu_affinity can now be passed [] argument as an alias to set affinity against all eligible CPUs.
Bug fixes
948, build-fail: cannot install psutil with PYTHONOPTIMIZE=2.
687, [Linux]: pid_exists no longer returns True if passed a process thread ID.
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 killed by a signal.
961, [Windows]: WindowsService.description method may fail with ERROR_MUI_FILE_NOT_FOUND.
2017-02-01
Enhancements
357_: added `Process.cpu_num()`_ (what CPU a process is on).
371_: added `sensors_temperatures()`_ (Linux only).
941_: added `cpu_freq()`_ (CPU frequency).
955_: added `sensors_battery()`_ (Linux, Windows, only).
956_: `Process.cpu_affinity()`_ can now be passed [] argument 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_: `psutil.Popen`_ wait() did not return the correct negative exit status if process is killed by a signal.
961_, [Windows]: WindowsService.description() method may fail with ERROR_MUI_FILE_NOT_FOUND.
939: tar.gz distribution went from 1.8M to 258K.
Build and packaging
939: tar.gz distribution went from 1.8M to 258K.
Bug fixes
609, [SunOS], build-fail: psutil does not compile on Solaris 10.
936, [Windows], build-fail: fix compilation error on VS 2013 (patch by Max Bélanger).
811, [Windows]: provide a more meaningful error message if trying to use psutil on unsupported Windows XP.
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]: pids was omitting PID 0.
2016-12-21
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], [critical]: 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]: `pids()`_ was omitting PID 0.
799: new Process.oneshot context manager (+2x faster in general, +2x to +6x on Windows).
New APIs
799: new Process.oneshot context manager (+2x faster in general, +2x to +6x on Windows).
Bug fixes
933, [Windows], memleak: memory leak in cpu_stats and WindowsService.description method.
932, [NetBSD]: net_connections and Process.connections may fail without raising an exception.
943: better error message in case of version conflict on import.
2016-11-06
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() method.
931, [SunOS], build-fail: psutil no longer compiles on Solaris.
Bug fixes
931, [SunOS], build-fail: psutil no longer compiles on Solaris.
2016-10-26
Bug fixes
931_, [critical]: psutil no longer compiles on Solaris.
927: Popen __del__ may cause maximum recursion depth error.
Bug fixes
927: Popen __del__ may cause maximum recursion depth error.
2016-10-25
Bug fixes
927_, [critical]: `psutil.Popen`_ __del__ may cause maximum recursion depth error.
874, [Windows]: make net_if_addrs also return the netmask.
New APIs
874, [Windows]: make net_if_addrs also return the netmask.
API changes
887, [Linux]: virtual_memory available and used are more precise and match free utility. Also handles LXC containers.
Internals
891: scripts/procinfo.py has been updated and provides a lot more info.
Bug fixes
514, [macOS], critical: Process.memory_maps can segfault.
926, [macOS], critical: Process.environ can crash the interpreter on Python 3 if the process environment contains an invalid unicode string.
783, [macOS]: Process.status may erroneously return STATUS_RUNNING for zombie processes.
798, [Windows]: Process.open_files returns and empty list on Windows 10.
825, [Linux]: Process.cpu_affinity: fix possible double close and use of unopened socket.
880, [Windows]: fix race condition inside net_connections.
885: ValueError is raised if a negative integer is passed to cpu_percent functions.
892, [Linux]: Process.cpu_affinity with [-1] as arg raises SystemError with no error set; now ValueError is raised.
906, [BSD]: disk_partitions with all=False returned an empty list. Now the argument is ignored and all partitions are always returned.
907, [FreeBSD]: Process.exe may fail with OSError ENOENT.
908, [macOS], [BSD]: different process methods could errounesuly mask the real error for high-privileged PIDs and raise NoSuchProcess and AccessDenied instead of OSError and RuntimeError.
909, [macOS]: Process.open_files and Process.connections methods may raise OSError with no exception set if process is gone.
916, [macOS]: fix many compilation warnings.
2016-10-23
Enhancements
874_, [Windows]: make `net_if_addrs()`_ also return the netmask.
887_, [Linux]: `virtual_memory()`_ 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
514_, [macOS], [critical]: `Process.memory_maps()`_ can segfault.
783_, [macOS]: `Process.status()`_ may erroneously return "running" for zombie processes.
798_, [Windows]: `Process.open_files()`_ returns and empty list on Windows 10.
825_, [Linux]: `Process.cpu_affinity()`_: fix possible double close and use of unopened socket.
880_, [Windows]: fix race condition inside `net_connections()`_.
885_: ValueError is raised if a negative integer is passed to `cpu_percent()`_ functions.
892_, [Linux], [critical]: `Process.cpu_affinity()`_ with [-1] as arg raises SystemError with no error set; now ValueError is raised.
906_, [BSD]: `disk_partitions()`_ with all=False returned an empty list. Now the argument is ignored and all partitions are always returned.
907_, [FreeBSD]: `Process.exe()`_ may fail with OSError(ENOENT).
908_, [macOS], [BSD]: different process methods could errounesuly mask the real error for high-privileged PIDs and raise `NoSuchProcess`_ and `AccessDenied`_ instead of OSError and RuntimeError.
909_, [macOS]: `Process.open_files()`_ and `Process.connections()`_ methods may raise OSError with no exception set if process is gone.
916_, [macOS]: fix many compilation warnings.
858: Process.as_dict should not call Process.memory_info_ex() because it's deprecated.
Build and packaging
881: make install now works also when using a virtual env.
Bug fixes
870, [Windows], memleak: handle leak inside psutil_get_process_data.
854: Process.as_dict raises ValueError if passed an erroneous attrs name.
857, [SunOS]: Process.cpu_times, Process.cpu_percent, Process.threads and Process.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 call Process.memory_info_ex() because it's deprecated.
863, [Windows]: Process.memory_maps 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).
812, [NetBSD], build-fail: fix compilation on NetBSD-5.x.
Bug fixes
812, [NetBSD], build-fail: fix compilation on NetBSD-5.x.
810, [Windows]: Windows wheels are incompatible with pip 7.1.2.
823, [NetBSD]: virtual_memory raises TypeError on Python 3.
829, [POSIX]: disk_usage percent field takes root reserved space into account.
816, [Windows]: fixed net_io_counters values wrapping after 4.3GB in Windows Vista (NT 6.0) and above using 64bit values from newer win APIs.
2016-06-18
Enhancements
819_, [Linux]: different speedup improvements: `Process.ppid()`_ +20% faster. `Process.status()`_ +28% faster. `Process.name()`_ +25% faster. `Process.num_threads()`_ +20% faster on Python 3.
Bug fixes
810_, [Windows]: Windows wheels are incompatible with pip 7.1.2.
812_, [NetBSD], [critical]: fix compilation on NetBSD-5.x.
823_, [NetBSD]: `virtual_memory()`_ raises TypeError on Python 3.
829_, [POSIX]: `disk_usage()`_ percent field takes root reserved space into account.
816_, [Windows]: fixed `net_io_counters()`_ values wrapping after 4.3GB in Windows Vista (NT 6.0) and above using 64bit values from newer win APIs.
Your coding agent can read these notes before it upgrades. Set up the MCP server →