Changelog
8.0.0 (IN DEVELOPMENT)
Note
psutil 8.0 introduces breaking API changes. See the migration guide if upgrading from 7.x.
Enhancements
Doc improvements (#2761, #2757, #2760, #2745, #2763, #2764, #2767, #2768, #2769, #2771, #2774, #2775, #2781, #2787, #2739, #2790, #2797, #2801, #2803, #2808, #2819, #2820, #2823, #2826, #2828, #2829)
Split docs from a single HTML file into multiple new sections:
/about (linked from footer) list all keyboard shortcuts
/adoption: notable software using psutil
/alternatives: list of alternative Python libraries and tools that overlap with psutil.
/api-overview: show entire API via REPL usage examples
/credits: list contributors and donors (was old
CREDITSin root dir)/faq: extended FAQ section
/funding: list funding methods and current sponsors
/genindex: a general index
/glossary: core concepts explained
/install: (was old
INSTALL.rstin root dir)/migration: explain how to migrate to newer psutil versions that break backward compatibility
/performance: how to use psutil efficiently
/platform: summary of OSes and architectures support
/recipes: code samples
/shell-equivalents: maps each psutil API to native CLI commands
/stdlib-equivalents: maps psutil’s Python API to the closest equivalent in the Python standard library
Blog:
#2825: new blog at /blog, built via the ablog Sphinx extension, with 20 posts imported from https://gmpy.dev, covering psutil topics from 2014 to 2026. Includes Atom feed. Posts are searchable. Use OpenGraph for nice preview when posts are shared on social media.
Theming:
Renewed, modern, custom theme.
Top bar
Toggable dark theme (
Shift+Dkeyboard shortcut).Show “last updated” and external icons in the footer.
Show icon for external URLs.
Use Monokai theme for code snippets.
Usability:
Right TOC sidebar.
Improved overall doc clarity and shortened long sentences.
Show a clickable COPY button to copy code snippets.
Show
psutil.prefix for all APIs.Search:
Ctrl+Kto focus the search box (replaces/).Search:
Up/Downarrow keys navigate results;Enteropens the selected result.Search results are styled as cards with subtle borders and shadows (no longer rely on RTD).
Identifiers in code blocks (e.g.
psutil.Process(),p.cpu_percent()) are now clickable and link to their API reference entry on click, via sphinx-codeautolink.
Testing:
Replace
rstcheckwithsphinx-lintfor RST linting.Add custom script to detect dead reference links in
.rstfiles.Use sphinx extension to validate Python code snippets syntax at build-time.
New
make test-docswith sanity checks for built HTML docs.
RTD:
Configured RTD to automatically public doc from Git tags, instead of from main on every push.
Removed /en language from RTD URLs. Turn that into a redirect. - Before: https://psutil.readthedocs.io/en/stable/ - Now: https://psutil.readthedocs.io/stable/
Misc:
Build doc as part of CI process (fails on error).
All
.rstfiles are now wrapped to 79 characters via https://github.com/giampaolo/rstwrap.Add
/sitemap.xmlto help search engine discovery.Custom 404 page. Hovering over the © copyright in the footer reveals an easter egg. Clicking it takes you to the 404 page containing a joke.
Type hints / enums:
#1946: Add inline type hints to all public APIs in
psutil/__init__.py. Type checkers (mypy, pyright, etc.) can now statically verify code that uses psutil. No runtime behavior is changed; the annotations are purely informational.#2751: Convert all named tuples from
collections.namedtuple()totyping.NamedTupleclasses with type annotations. This makes the classes self-documenting, effectively turning this module into a readable API reference.#2753: Introduce enum classes (
ProcessStatus,ConnectionStatus,ProcessIOPriority,ProcessPriority,ProcessRlimit) grouping related constants. The individual top-level constants (e.g.STATUS_RUNNING) remain the primary API, and are now aliases for the corresponding enum members.
New APIs:
#2798: new
Process.attrsclass attribute, afrozensetof valid attribute names accepted byProcess.as_dict()andprocess_iter(). Replaces the old pattern of callinglist(psutil.Process().as_dict().keys()). Passing an empty list toprocess_iter()(attrs=[]) to mean “retrieve all attributes” is deprecated. Useattrs=Process.attrsinstead. See migration guide.#1541: New
Process.page_faults()method, returning a(minor, major)named tuple.Reorganization of process memory APIs (#2731, #2736, #2723, #2733).
Add new
Process.memory_info_ex()method (not to be confused with the old method with the same name, deprecated in 4.0 and removed in 7.0), which extendsProcess.memory_info()with platform-specific metrics:Linux:
peak_rss,peak_vms,rss_anon,rss_file,rss_shmem,swap,hugetlbmacOS:
peak_rss,rss_anon,rss_file,wired,compressed,phys_footprintWindows:
virtual,peak_virtual
Add new
Process.memory_footprint()method, which returnsuss,pssandswapmetrics (whatProcess.memory_full_info()used to return, which is now deprecated, see migration guide).Process.memory_info()named tuple changed:BSD: added
peak_rss.Linux:
libanddirtyremoved (always 0 since Linux 2.6). Deprecated aliases returning 0 and emittingDeprecationWarningare kept.macOS:
pfaultsandpageinsremoved with no backward-compatible aliases. UseProcess.page_faults()instead.Windows: eliminated old aliases:
wset→rss,peak_wset→peak_rss,pagefileandprivate→vms,peak_pagefile→peak_vms. At the same timepaged_pool,nonpaged_pool,peak_paged_pool,peak_nonpaged_poolwere moved toProcess.memory_info_ex(). All these old names still work but raiseDeprecationWarning. See migration guide.
Process.memory_full_info()is deprecated. Use the newProcess.memory_footprint()instead. See migration guide.
Others:
#2747: the field order of the named tuple returned by
cpu_times()has been normalized on all platforms, and the first 3 fields are now alwaysuser,system,idle. See compatibility notes below.#2754: standardize
sensors_battery()’spercentso that it returns afloatinstead ofinton all systems, not only Linux.#2765: add a PR bot that uses Claude to summarize PR changes and update
changelog.rstandcredits.rstwhen commenting with /changelog.#2766: remove remaining Python 2.7 compatibility shims from
setup.py, simplifying the build infrastructure.#2772, [Windows]:
cpu_times()interruptfield renamed toirqto match the field name used on Linux and BSD.interruptstill works but raisesDeprecationWarning. See migration guide.#2776, [Windows]:
virtual_memory()now includescachedandwiredfields.#2780, [Windows]:
disk_usage()now can accept a file path (not only a directory path).#2784:
process_iter(): when attrs is specified, the pre-fetched values are now cached directly on theProcessinstance. Subsequent method calls (e.g.p.name(),p.status()) return the cached values instead of making new system calls. Thep.infodict is deprecated. See migration guide.#2788: git tags renamed from
release-X.Y.ZtovX.Y.Z(e.g.release-7.2.2→v7.2.2). Old tags are kept for backward compatibility.#2799:
Process.as_dict()now returns a dict with keys sorted alphabetically when attrs is not specified.#2805, [BSD]: remove
procfsdependency on NetBSD forcpu_stats()andvirtual_memory(); values are now retrieved via thesysctl(9)anduvm(9)kernel APIs instead. (patch by Santhosh Raju)#2816, [OpenBSD]:
swap_memory()sinandsoutare no longer set to0.
Bug fixes
#1007, [Windows]:
boot_time()no longer fluctuates by ~1 second across calls or across processes. It is now read atomically from the kernel viaNtQuerySystemInformation(SystemTimeOfDayInformation), replacing the oldtime.time() - uptime()computation that sampled two counters from Python and produced sub-second differences.#2411 [macOS]:
Process.cpu_times()andProcess.cpu_percent()calculation on macOS x86_64 (arm64 is fine) was highly inaccurate (41.67x lower).#2715, [Linux]:
wait_pid_pidfd_open()(fromProcess.wait()) crashes withEINVALdue to kernel race condition.#2726, [macOS]:
Process.num_ctx_switches()return an unusual high number due to a C type precision issue.#2732, [Linux]:
net_if_stats(): handleEBUSYfromioctl(SIOCETHTOOL).#2770, [Linux]: fix
cpu_count()(logical=False) raisingValueErroron s390x architecture, where/proc/cpuinfouses spaces before the colon separator instead of a tab.#2744, [NetBSD]: fix possible double
free()inswap_memory().#2746, [FreeBSD]:
Process.memory_maps(),rssandprivatefields are erroneously reported in memory pages instead of bytes. Other platforms (Linux, macOS, Windows) return bytes.#2778, [UNIX]:
net_if_addrs()skips interfaces with no addresses, which are typically virtual IPv4/IPv6 tunnel interfaces. Now they are included in the returned dict withfamily==socket.AF_UNSPECand an empty list of addresses. Main reason: it creates an inconsistency withnet_io_counters()andnet_if_stats()which do return these interface names.#2782, [FreeBSD]:
cpu_count()logical=Falsereturn None on systems without hyper threading.#2791, [FreeBSD]: relax
psutil_sysctl()/psutil_sysctlbyname()to allow the kernel to return fewer bytes than the buffer (normal for variable-lengthsysctldata).#2795, [FreeBSD]: fix
cpu_freq()failing withRuntimeError: sysctlbyname('dev.cpu.0.freq_levels') size mismatchon some systems.#2811, [OpenBSD]:
virtual_memory()sharedfield returned pages instead of bytes, plus it was overvalued (summed sharedvirtual+real, now we only returnreal).#2813, [OpenBSD]:
virtual_memory()bufferswas always 0. Now it returns a meaningful value, which is the same ascached. That’s because OpenBSD does not distinguish between the 2.#2814, [NetBSD]:
virtual_memory()cachedis overvalued, since it includes anonymous pages.#2815, [OpenBSD]:
virtual_memory()sharedwas overvalued (summed sharedvirtual+real, now we only returnreal).#2822, [BSD]:
Process.cmdline()on NetBSD could raiseOSError: [Errno 14] Bad addressif the process about to exit. It now raisesNoSuchProcessinstead.
7.2.2 — 2026-01-28
Enhancements
#2705: [Linux]:
Process.wait()now usespidfd_open()+poll()(no busy loop). Requires Linux >= 5.3 and Python >= 3.9.#2705: [macOS], [BSD]:
Process.wait()now useskqueue()(no busy loop).
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()andProcess.threads().#2708, [macOS]:
Process.cmdline()andProcess.environ()may fail withOSError: [Errno 0] Undefined error(fromsysctl(KERN_PROCARGS2)). They now raiseAccessDeniedinstead.
7.2.1 — 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.
7.2.0 — 2025-12-23
Enhancements
#1275: new
heap_info()andheap_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 ofpsutil/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 missingPy_CLEAR.
Compatibility notes
#2680:
import psutil.testsno longer works (but it was never documented to begin with).
7.1.3 — 2025-11-02
Enhancements
#2667: enforce
clang-formaton 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_swithstr_format, andstrlcat/strlcpywithstr_copy/str_append. Unifies string handling across platforms.
Bug fixes
#2674, [Windows]:
disk_usage()could truncate values on 32-bit platforms, potentially reporting incorrecttotal,free,usedspace for drives larger than 4GB.#2675, [macOS]:
Process.status()incorrectly returnsSTATUS_RUNNINGfor 99% of the processes.#2677, [Windows]: fix MAC address string construction in
net_if_addrs()(buffer overflow / misformat risk).#2679, [OpenBSD], [NetBSD], [critical]: can’t build due to C syntax error.
7.1.2 — 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()andProcess.environ()may incorrectly raiseNoSuchProcessinstead ofZombieProcess.#2658, [macOS]: double
free()inProcess.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.
7.1.1 — 2025-10-19
Enhancements
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.
7.1.0 — 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
dprintCLI tool to format .yml and .md files.
Bug fixes
#2473, [macOS]: Fix build issue on macOS 11 and lower.
#2494, [Windows]:
Process.memory_maps(),Process.exe()andProcess.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 withFileNotFoundErrordue to a race condition.#2526, [Linux]:
Process.create_time()now uses a monotonic clock, preventingProcess.is_running()from returning wrong results after system clock updates. (patch by Jonathan Kohler)#2528, [Linux]:
Process.children()may raisePermissionError. It will now raiseAccessDeniedinstead.#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()andProcess.parent()may not be able to return the right information.#2545: [Illumos]: Fix handling of
MIB2_UDP_ENTRYinnet_connections().#2552, [Windows]:
boot_time()didn’t take into account the time spent during suspend / hibernation.#2560, [Linux]:
Process.memory_maps()may crash withIndexErroron RISCV64 due to a malformed/proc/pid/smapsfile. (patch by Julien Stephan)#2586, [macOS], [CRITICAL]: fixed different places in C code which can trigger a segfault.
#2604, [Linux]:
virtual_memory()usedfield does not match recent versions offreeCLI utility. (patch by Isaac K. Ko)#2605, [Linux]:
sensors_battery()reports a negative amount for seconds left.#2607, [Windows]:
WindowsService.description()method may fail withERROR_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.
7.0.0 — 2025-02-13
Enhancements
#669, [Windows]:
net_if_addrs()also returns thebroadcastaddress instead ofNone.#2480: drop Python 2.7 support. Latest version supporting it is psutil 6.1.X (
pip2 install psutil==6.1.*).#2490: remove long deprecated
Process.memory_info_ex()(deprecated since 4.0.0). UseProcess.memory_full_info()instead.
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 useshost_statistics64(same asvm_stat), more accurate.
Compatibility notes
#2480: Python 2.7 is no longer supported.
#2490: removed long deprecated
Process.memory_info_ex()method.
6.1.1 — 2024-12-19
Enhancements
#2471: use Vulture CLI tool to detect dead code.
Bug fixes
#2418, [Linux]: fix race condition in case
/proc/pid/statdoes not exist, but/proc/piddoes, resulting inFileNotFoundError.#2470, [Linux]:
users()may return “localhost” instead of the actual IP address of the user logged in.
6.1.0 — 2024-10-17
Enhancements
#2366, [Windows]: drastically speedup
process_iter()by using process “fast” create time to determine process identity.#2446: use pytest instead of unittest.
#2448: add
make install-sysdepstarget to install the necessary system dependencies (python-dev, gcc, etc.) on all supported UNIX flavors.#2449: add
make install-pydeps-testandmake install-pydeps-devtargets. They can be used to install dependencies meant for running tests and for local development. They can also be installed viapip install .[test]andpip install .[dev].#2456: allow running tests via
python3 -m psutil.testseven ifpytestis not installed.
Bug fixes
#2427: psutil (segfault) on import in the free-threaded (no GIL) version of Python 3.13. (patch by Sam Gross)
#2455, [Linux]:
IndexErrormay occur when reading/proc/pid/statand 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()andProcess.open_files()may fail withNoSuchProcessfor PID 0. Instead, we now return “null” values (0and[]respectively).
6.0.0 — 2024-06-18
Enhancements
#2109: remove
maxfileandmaxpathfromdisk_partitions()(can be very slow on NFS).#2366, [Windows]: log debug message when using slower process APIs.
#2375, [macOS]: provide arm64 wheels. (patch by Matthieu Darbois)
#2396:
process_iter()no longer preemptively checks whether PIDs have been reused, making it around 20x faster.#2396: a new
process_iter.cache_clear()API can be used to clearprocess_iter()internal cache.#2401, Support building with free-threaded CPython 3.13. (patch by Sam Gross)
#2407: rename
Process.connections()toProcess.net_connections(). Old name still works but is deprecated.#2425: [Linux]: provide aarch64 wheels. (patch by Matthieu Darbois / Ben Raz)
Bug fixes
#2250, [NetBSD]:
Process.cmdline()sometimes fail withEBUSYfor long cmdlines. Now retries up to 50 times, returning an empty list as last resort.#2254, [Linux]: offline cpus raise
NotImplementedErrorincpu_freq()(patch by Shade Gladden)#2272: Add pickle support to psutil Exceptions.
#2359, [Windows], [CRITICAL]:
pid_exists()disagrees withProcesson whether a pid exists whenERROR_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 named tuple returned by
disk_partitions()’ no longer hasmaxfileandmaxpathfields.#2396:
process_iter()no longer preemptively checks whether PIDs have been reused. UseProcess.is_running()on yielded instances instead (also removes reused PIDs from the internal cache).#2407: rename
Process.connections()toProcess.net_connections(). Old name still works but is deprecated.
5.9.8 — 2024-01-19
Enhancements
#2343, [FreeBSD]: filter
net_connections()in C instead of Python, ~4x faster. Only requested connection types are now retrieved.#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 raisingNoSuchProcess.#2345, [Linux]: fix compilation on older compiler missing
NIC_DUPLEX_UNKNOWN.#2222, [macOS]:
cpu_freq()now returns fixed values forminandmaxfrequencies in all Apple Silicon chips.
5.9.7 — 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_SetExcFromWindowsErrWithFilenameObjectcPython API.
5.9.6 — 2023-10-15
Enhancements
#1703:
cpu_percent()andcpu_times_percent()are now thread safe.#2266: if
Processclass is passed a very high PID, raiseNoSuchProcessinstead ofOverflowError. (patch by Xuehai Pan)#2246: drop python 3.4 & 3.5 support. (patch by Matthieu Darbois)
#2290: PID reuse is now preemptively checked for
Process.ppid()andProcess.parents().#2312: use
rufflinter instead offlake8 + isort.
Bug fixes
#2195, [Linux]: no longer print exception at import time in case
/proc/statcan’t be read due to permission error. Redirect it toPSUTIL_DEBUGinstead.#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 raiseZombieProcessif it’s determined via/proc/pid/smaps_rollup. Instead we now fallback on reading/proc/pid/smaps.#2287, [OpenBSD], [NetBSD]:
Process.is_running()erroneously returnFalsefor zombie processes, because creation time cannot be determined.#2288, [Linux]: correctly raise
ZombieProcessonProcess.exe(),Process.cmdline()andProcess.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 withAccessDenied(also as root).
5.9.5 — 2023-04-17
Enhancements
#2196: in case of exception, display a cleaner error traceback by hiding the
KeyErrorbit deriving from a missed cache hit.#2217: print the full traceback when a
DeprecationWarningorUserWarningis raised.#2230, [OpenBSD]:
net_connections()rewritten from scratch: now retrievessocket.AF_UNIXsocket 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 raisingZombieProcesswhen the full name can’t be determined fromProcess.cmdline().#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/meminforeturns0(possibly a kernel bug), in which case we calculate an approximation foravailablememory 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/filesystemsand raiseAccessDeniedunless user specifiedall=Falseargument.#2216, [Windows]: fix tests when running in a virtual environment (patch by Matthieu Darbois)
#2225, [POSIX]:
users()loses precision forstartedfield (off by 1 minute).#2229, [OpenBSD]: unable to properly recognize zombie processes.
NoSuchProcessmay be raised instead ofZombieProcess.#2231, [NetBSD]:
availablevirtual_memory()is higher thantotal.#2234, [NetBSD]:
virtual_memory()metrics are wrong:availableandusedare too high. We now match values shown by htop CLI utility.#2236, [NetBSD]:
Process.num_threads()andProcess.threads()return threads that are already terminated.#2237, [OpenBSD], [NetBSD]:
Process.cwd()may raiseFileNotFoundErrorif cwd no longer exists. Return an empty string instead.
5.9.4 — 2022-11-07
Enhancements
#2102: use Limited API when building wheels with CPython 3.6+ on Linux, macOS and Windows. (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_UNKNOWNdefinition. (patch by Amir Rossert)#2010, [macOS]: on MacOS, arm64
IFM_1000_TXandIFM_1000_Tare the same value, causing a build failure. (patch by Lawrence D’Anna)#2160, [Windows]: get
swap_memory()percentusage from performance counters. (patch by Daniel Widdis)
5.9.3 — 2022-10-18
Enhancements
#2040, [macOS]: provide wheels for arm64 architecture. (patch by Matthieu Darbois)
Bug fixes
#2116, [macOS], [critical]:
net_connections()fails withRuntimeError.#2135, [macOS]:
Process.environ()may contain garbage data. Fix out-of-bounds read aroundsysctl_procargs. (patch by Bernhard Urban-Forster)#2138, [Linux], [critical]: can’t compile psutil on Android due to undefined
ethtool_cmd_speedsymbol.#2142, [POSIX]:
net_if_stats()‘sflagson 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 raiseNoSuchProcess. Fix race condition. (patch by Daniel Li)#2153, [macOS] Fix race condition in
test_posix.TestProcess.test_cmdline. (patch by Matthieu Darbois)
5.9.2 — 2022-09-04
Bug fixes
#2093, [FreeBSD], [critical]:
pids()may fail with ENOMEM. Dynamically increase themalloc()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)
5.9.1 — 2022-05-20
Enhancements
#1053: drop Python 2.6 support. (patches by Matthieu Darbois and Hugo van Kemenade)
#2037: add
flagsfield tonet_if_stats().#2050, [Linux]: increase read(2) buffer size from 1k to 32k when reading
/procpseudo files line by line.#2057, [OpenBSD]: add support for
cpu_freq().#2107, [Linux]:
Process.memory_full_info()now reads/proc/pid/smaps_rollupinstead of/proc/pid/smaps(5x faster).
Bug fixes
#2048:
AttributeErroris raised ifpsutil.Errorclass is raised manually and passed throughstr.#2049, [Linux]:
cpu_freq()erroneously returnscurrentvalue in GHz whileminandmaxare in MHz.#2050, [Linux]:
virtual_memory()may raiseValueErrorif running in a LCX container.
5.9.0 — 2021-12-29
Enhancements
#1851, [Linux]:
cpu_freq()reads from/proc/cpuinfoinstead of many files in/sysfs, faster on systems with many CPUs. (patch by marxin)#1992:
NoSuchProcessmessage now specifies if the PID has been reused. Error classes now have improved__repr__and__str__.#1996, [BSD]: add support for MidnightBSD. (patch by Saeed Rasooli)
#1999, [Linux]:
disk_partitions(): convert/dev/rootdevice (an alias used on some Linux distros) to real root device path.#2005:
PSUTIL_DEBUGmode 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()minandmaxare set to 0 if can’t be determined (instead of crashing).#1512, [macOS]: sometimes
Process.connections()will crash withEOPNOTSUPPfor 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.#1901, [macOS]:
Process.open_files(),Process.connections()and others could randomly raiseAccessDeniedbecause the internal buffer ofproc_pidinfo(PROC_PIDLISTFDS)was too small. Now dynamically increased until sufficient.#1904, [Windows]:
OpenProcessfails withERROR_SUCCESSdue toGetLastError()called aftersprintf(). (patch by @alxchk)#1913, [Linux]:
wait_procs()should catchsubprocess.TimeoutExpiredexception.#1919, [Linux]:
sensors_battery()can raiseTypeErroron PureOS.#1921, [Windows]:
swap_memory()shows committed memory instead of swap.#1940, [Linux]: psutil does not handle
ENAMETOOLONGwhen accessing process file descriptors in procfs. (patch by Nikita Radchenko)#1948, [critical]:
memoize_when_activateddecorator 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. (patch by PetrPospisil)#1991, [critical]:
process_iter()is not thread safe and can raiseTypeErrorif 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.
5.8.0 — 2020-12-19
Enhancements
#1863:
disk_partitions()exposes 2 extra fields:maxfileandmaxpath, 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: 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], [critical]: always raise
AccessDeniedinstead ofWindowsErrorwhen failing to query 64 processes from 32 bit ones by usingNtWoW64APIs.#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 raiseERROR_NONE_MAPPEDif the SID has no corresponding account name. In this caseAccessDeniedis now raised.#1886, [macOS]:
EIOerror may be raised onProcess.cmdline()andProcess.environ(). Now it gets translated intoAccessDenied.#1887, [Windows], [critical]:
OpenProcessmay fail with “[WinError 0] The operation completed successfully”.” Turn it intoAccessDeniedorNoSuchProcessdepending on whether the PID is alive.#1891, [macOS]: get rid of deprecated
getpagesize().
5.7.3 — 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()isupalso 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
secsleftcalculation (patch by @aristocratos)
Bug fixes
#1620, [Linux]:
cpu_count()withlogical=Falseresult is incorrect on systems with more than one CPU socket. (patch by Vincent A. Arcila)#1738, [macOS]:
Process.exe()may raiseFileNotFoundErrorif 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(): ifpercentcan be determined but not the remaining values, still return a result instead ofNone. (patch by @aristocratos)
5.7.2 — 2020-07-15
Bug fixes
wheels for 2.7 were inadvertently deleted.
5.7.1 — 2020-07-15
Enhancements
#1729: parallel tests on POSIX (
make test-parallel). They’re twice as fast!#1741, [POSIX]:
make buildnow 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:
Processclass provides more info about the process onstr()andrepr()(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]:
NoSuchProcessmay be raised instead ofZombieProcess.#1781, [critical]:
getloadavg()can crash the Python interpreter. (patch by Ammar Askar)
5.7.0 — 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 raisingAccessDenied).#1679, [Windows]:
net_connections()andProcess.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()andusers()’s login time now have 1 micro second precision (before the precision was of 1 second).
Bug fixes
#1538, [NetBSD]:
Process.cwd()may returnENOENTinstead ofNoSuchProcess.#1627, [Linux]:
Process.memory_maps()can raiseKeyError.#1642, [SunOS]: querying basic info for PID 0 results in
FileNotFoundError.#1646, [FreeBSD], [critical]: many
Processmethods may cause a segfault due to a backward incompatible change in a C type on FreeBSD 12.0.#1656, [Windows]:
Process.memory_full_info()raisesAccessDeniedeven for the current user andos.getpid().#1660, [Windows]:
Process.open_files()rewritten with proper error handling.#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).
#1673, [OpenBSD]:
Process.connections(),Process.num_fds()andProcess.threads()raised wrong exception if process is gone.#1674, [SunOS]:
disk_partitions()may raiseOSError.#1684, [Linux]:
disk_io_counters()may raiseValueErroron systems not having/proc/diskstats.#1695, [Linux]: could not compile on kernels <= 2.6.13 due to
PSUTIL_HAS_IOPRIOnot being defined. (patch by Anselm Kruis)
5.6.7 — 2019-11-26
Bug fixes
#1630, [Windows], [critical]: can’t compile source distribution due to C syntax error.
5.6.6 — 2019-11-25
Bug fixes
#1179, [Linux]:
Process.cmdline()now handles processes that use inappropriate chars to separate args.#1616, [critical]: use of
Py_DECREFinstead ofPy_CLEARwill result in doublefree()and segfault (CVE-2019-18874). (patch by Riccardo Schirone)#1619, [OpenBSD], [critical]: compilation fails due to C syntax error. (patch by Nathan Houghton)
5.6.5 — 2019-11-06
Bug fixes
#1615: remove
pyproject.tomlas it was causing installation issues.
5.6.4 — 2019-11-04
Enhancements
#1527, [Linux]: added
Process.cpu_times()iowaitcounter, 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()orProcess.cwd()may occasionally fail withERROR_PARTIAL_COPYwhich now gets translated toAccessDenied.#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:
typeandfamilyfields returned bynet_connections()are not always turned into enums.#1536, [NetBSD]:
Process.cmdline()erroneously raiseZombieProcesserror 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)
5.6.3 — 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()andProcess.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 raiseMemoryError. (patch by Kamil Rytarowski)
5.6.2 — 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()withlogical=Falsefalls back to reading/sys/devices/system/cpu/*/topology/core_idif/proc/cpuinfodoesn’t provide the 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]:
Process.ionice()can now set high I/O priority. 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()returnsNoneinstead of 0.0 whenminandmaxfields can’t be determined. (patch by Alex Manuskin)#1462, [Linux]: (tests) make tests invariant to
LANGsetting (patch by Benjamin Drung)#1463: scripts/cpu_distribution.py was broken.
#1470, [Linux]:
disk_partitions(): fix corner case when/etc/mtabdoesn’t exist. (patch by Cedric Lamoriniere)#1471, [SunOS]:
Process.name()andProcess.cmdline()can returnSystemError. (patch by Daniel Beer)#1472, [Linux]:
cpu_freq()does not return all CPUs on Raspberry-pi 3.#1474: fix formatting of
psutil.tests()which mimicsps auxoutput.#1475, [Windows], [critical]:
OSError.winerrorattribute wasn’t properly checked resulting inWindowsError(ERROR_ACCESS_DENIED)being raised instead ofAccessDenied.#1477, [Windows]: wrong or absent error handling for private
NTSTATUSWindows APIs. Different process methods were affected by this.#1480, [Windows], [critical]:
cpu_count()withlogical=Falsecould cause a crash due to fixed read violation. (patch by Samer Masterson)#1486, [AIX], [SunOS]:
AttributeErrorwhen interacting withProcessmethods involved intoProcess.oneshot()context.#1491, [SunOS]:
net_if_addrs(): usefree()againstifapstruct on error. (patch by Agnewee)#1493, [Linux]:
cpu_freq(): handle the case where/sys/devices/system/cpu/cpufreq/exists but it’s empty.
5.6.1 — 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
rtlIpv6AddressToStringAnot available on Wine.#1451, [Windows], [critical]:
Process.memory_full_info()segfaults.NtQueryVirtualMemoryis now used instead ofQueryWorkingSetto calculate USS memory.
5.6.0 — 2019-03-05
Enhancements
#1379, [Windows]:
Process.suspend()andProcess.resume()now useNtSuspendProcess/NtResumeProcessinstead of stopping / resuming all threads. Faster and more reliable.#1420, [Windows]: in case of exception
disk_usage()now also shows the path name.#1422, [Windows]: DLL-loaded Windows APIs are now loaded once on startup instead of per function call, significantly faster.
#1426, [Windows]:
PAGESIZEand 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)#1442: Python 3 is now the default interpreter used by Makefile.
Bug fixes
#1353:
process_iter()is now thread safe (it rarely raisedTypeError).#1394, [Windows], [critical]:
Process.name()andProcess.exe()may erroneously return “Registry” or fail with “[Error 0] The operation completed successfully”.QueryFullProcessImageNameWis now used instead ofGetProcessImageFileNameWin order to prevent that.#1411, [BSD]: lack of
Py_DECREFcould cause segmentation fault on process instantiation.#1419, [Windows]:
Process.environ()raisesNotImplementedErrorwhen querying a 64-bit process in 32-bit-WoW mode. Now it raisesAccessDenied.#1427, [OSX]:
Process.cmdline()andProcess.environ()may erroneously raiseOSErroron failedmalloc().#1429, [Windows]:
SE DEBUGwas not properly set for current process. It is now, and it should result in lessAccessDeniedexceptions for low PID processes.#1432, [Windows]:
Process.memory_info_ex()’s USS memory is miscalculated because we’re not using the actual systemPAGESIZE.#1439, [NetBSD]:
Process.connections()may return incomplete results if usingProcess.oneshot().#1447: original exception wasn’t turned into
NoSuchProcess/AccessDeniedexceptions when usingProcess.oneshot()context manager.
Incompatible API changes
#1291, [OSX], [critical]:
Process.memory_maps()was removed because inherently broken (segfault) for years.
5.5.1 — 2019-02-15
Enhancements
#1348, [Windows]: on Windows >= 8.1,
Process.cmdline()falls back toNtQueryInformationProcessonERROR_ACCESS_DENIED. (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)
5.5.0 — 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()andProcess.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 causesProcessinstances to return incorrect results.#1376, [Windows]:
OpenProcessnow usesPROCESS_QUERY_LIMITED_INFORMATIONwhere possible, reducingAccessDeniedfor system processes.#1376, [Windows]: check if variable is
NULLbeforefree()ing it. (patch by EccoTheFlintstone)
5.4.8 — 2018-10-30
Enhancements
#1197, [Linux]:
cpu_freq()falls back to/proc/cpuinfoif/sys/devices/system/cpu/*is not available.#1310, [Linux]:
sensors_temperatures()falls back to/sys/class/thermalif/sys/class/hwmonis 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 raiseValueError.#1277, [OSX]: available and used memory (
virtual_memory()) metrics are not accurate.#1294, [Windows]:
Process.connections()may sometimes fail with intermittent0xC0000001. (patch by Sylvain Duchesne)#1307, [Linux]:
disk_partitions()does not honourPROCFS_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)
5.4.7 — 2018-08-14
Enhancements
#1286, [macOS]:
OSXconstant is now deprecated in favor of newMACOS.#1309, [Linux]: added
STATUS_PARKEDconstant forProcess.status().#1321, [Linux]:
disk_io_counters()falls back to/sys/blockif/proc/diskstatsis not available. (patch by Lawrence Ye)
Bug fixes
#1209, [macOS]:
Process.memory_maps()may fail withEINVALdue to poortask_for_pid()syscall.AccessDeniedis 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 returnENODEV.#1294, [Windows]:
Process.connections()may sometime fail withMemoryError. (patch by @sylvainduchesne)#1305, [Linux]:
disk_io_counters()may report inflated r/w bytes values.#1309, [Linux]:
Process.status()is unable to recognizeidleandparkedstatuses (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 withValueError.
5.4.6 — 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()named tuple’s name has been renamed fromsnictosnicaddr.#1274, [Linux]: there was a small chance
Process.children()may swallowAccessDeniedexceptions.
5.4.5 — 2018-04-14
Bug fixes
#1268: setup.py’s
extra_requireparameter requires latest setuptools version, breaking quite a lot of installations.
5.4.4 — 2018-04-13
Enhancements
#1239, [Linux]: expose kernel
slabmemory field forvirtual_memory(). (patch by Maxime Mouial)
Bug fixes
#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()withpercpu=Truereturn fewer CPUs on systems using process groups (> 64 cores).#771, [Windows]:
cpu_stats()andcpu_freq()may return incorrect results on systems using process groups (> 64 cores).#1193, [SunOS]: return uid/gid from
/proc/pid/psinfoif there aren’t enough permissions for/proc/pid/cred. (patch by Georg Sauthoff)#1194, [SunOS]: return nice value from
psinfoasgetpriority()doesn’t support real-time processes. (patch by Georg Sauthoff)#1194, [SunOS]: fix double
free()inProcess.cpu_num(). (patch by Georg Sauthoff)#1194, [SunOS]: fix undefined behavior related to strict-aliasing rules and warnings. (patch by Georg Sauthoff)
#1210, [Linux]:
cpu_percent()steal time may remain stuck at 100% due to Linux erroneously reporting a decreased steal time between calls. (patch by Arnon Yaari)#1216: fix compatibility with Python 2.6 on Windows (patch by Dan Vinakovsky)
#1222, [Linux]:
Process.memory_full_info()was erroneously summing “Swap:” and “SwapPss:”. Same for “Pss:” and “SwapPss”. Not anymore.#1224, [Windows]:
Process.wait()may erroneously raiseTimeoutExpired.#1238, [Linux]:
sensors_battery()may returnNonein 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 withIOError“no such file”.#1255, [FreeBSD]:
swap_memory()stats were erroneously represented in KB. (patch by Denis Krienbühl)
Backward compatibility
#771, [Windows]:
cpu_count()withlogical=Falseon Windows XP and Vista is no longer supported and returnsNone.
5.4.3 — 2018-01-01
Enhancements
#775:
disk_partitions()on Windows return mount points.
Bug fixes
5.4.2 — 2017-12-07
Enhancements
#1173: add
PSUTIL_DEBUGenvironment variable to print debug messages on stderr.#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:
Process.memory_info_ex()now warns withFutureWarninginstead ofDeprecationWarning.
Bug fixes
#1152, [Windows]:
disk_io_counters()may return an empty dict.#1169, [Linux]:
users()hostnamereturns username instead. (patch by janderbrain)#1172, [Windows]:
make testdoes not work.#1179, [Linux]:
Process.cmdline()can now split args for processes that overwrite/proc/pid/cmdlinewith spaces instead of null bytes.#1181, [macOS]:
Process.memory_maps()may raiseENOENT.#1187, [macOS]:
pids()does not return PID 0 on recent macOS versions.
5.4.1 — 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
SIGTERMinstead of0. (patch by Akos Kiss)#1151:
python -m psutil.testsfail.#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)
5.4.0 — 2017-10-12
Enhancements
#1123, [AIX]: added support for AIX platform. (patch by Arnon Yaari)
Bug fixes
#1009, [Linux]:
sensors_temperatures()may crash withIOError.#1012, [Windows]:
disk_io_counters()read_timeandwrite_timewere 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 withIOError. (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)
5.3.1 — 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()raisesTypeError.
Compatibility notes
#1120:
.exefiles for Windows are no longer uploaded on PyPI as per PEP-527. Only wheels are provided.
5.3.0 — 2017-09-01
Enhancements
#802:
disk_io_counters()andnet_io_counters()no longer wrap (restart from 0). New nowrap argument.#928:
net_connections()andProcess.connections()laddrandraddrare now named tuples.#1015:
swap_memory()now reads/proc/meminfoinstead ofsysinfo()syscall, so it works withPROCFS_PATHfor containers.#1025:
process_iter()accepts new attrs and ad_value parameters to invokeProcess.as_dict()inline.#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 now only includes relevant files.
#1079, [FreeBSD]:
net_connections()fdnumber 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 first call value is now cached.#1013, [FreeBSD]:
net_connections()may return incorrect PID. (patch by Gleb Smirnoff)#1014, [Linux]:
Processclass can mask legitimateENOENTexceptions asNoSuchProcess.#1016:
disk_io_counters()raisesRuntimeErroron a system with no disks.#1017:
net_io_counters()raisesRuntimeErroron a system with no network cards installed.#1021, [Linux]:
Process.open_files()may erroneously raiseNoSuchProcessinstead of skipping a file which gets deleted while open files are retrieved.#1029, [macOS], [FreeBSD]:
Process.connections()withfamily=unixon Python 3 doesn’t properly handle unicode paths and may raiseUnicodeDecodeError.#1033, [macOS], [FreeBSD]: memory leak for
net_connections()andProcess.connections()when retrieving UNIX sockets (kind='unix').#1040: fixed many unicode related issues such as
UnicodeDecodeErroron Python 3 + POSIX and invalid encoded data on Windows.#1042, [FreeBSD], [critical]: psutil won’t compile on FreeBSD 12.
#1044, [macOS]: different
Processmethods incorrectly raiseAccessDeniedfor zombie processes.#1046, [Windows]:
disk_partitions()on Windows overrides user’sSetErrorMode.#1047, [Windows]:
Process.username(): memory leak in case exception is thrown.#1048, [Windows]:
users()’shostfield report an invalid IP address.#1050, [Windows]:
Process.memory_maps()leaks memory.#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()andnet_io_counters()raiseTypeErrorif 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 raiseSystemError.#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 raiseIOErroron old RedHat distros.#1074, [FreeBSD]:
sensors_battery()raisesOSErrorin 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 toNoneif <= 1.#1087:
Process.cpu_percent()guard againstcpu_count()returningNoneand assumes 1 instead.#1093, [SunOS]:
Process.memory_maps()shows wrong 64 bit addresses.#1094, [Windows]: fix
pid_exists()returning wrong result. AllOpenProcessAPIs 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 raiseAccessDeniedeven if the process already died.#1101, [Linux]:
sensors_temperatures()may raiseENODEV.
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()raddris now set to""instead ofNonewhen 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()’spathfield,WindowsService.binpath(),WindowsService.description(),WindowsService.display_name(),WindowsService.username().
5.2.2 — 2017-04-10
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 raiseValueError.#1006, [Linux]:
cpu_freq()may returnNoneon some Linux versions does not support the function. Let’s not make the function available instead.#1009, [Linux]:
sensors_temperatures()may raiseOSError.#1010, [Linux]:
virtual_memory()may raiseValueErroron Ubuntu 14.04.
5.2.1 — 2017-03-24
Bug fixes
#981, [Linux]:
cpu_freq()may return an empty list.#993, [Windows]:
Process.memory_maps()on Python 3 may raiseUnicodeDecodeError.#996, [Linux]:
sensors_temperatures()may not show all temperatures.#997, [FreeBSD]:
virtual_memory()may fail due to missingsysctlparameter on FreeBSD 12.
5.2.0 — 2017-03-05
Enhancements
#971, [Linux]: Add
sensors_fans()function. (patch by Nicolas Hennion)#976, [Windows]:
Process.io_counters()has 2 new fields:other_countandother_bytes.#976, [Linux]:
Process.io_counters()has 2 new fields:read_charsandwrite_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 forNtQueryObjecttimes out.#986, [Linux]:
Process.cwd()may raiseNoSuchProcessinstead ofZombieProcess.
5.1.3 — 2017-02-07
Bug fixes
#971, [Linux]:
sensors_temperatures()didn’t work on CentOS 7.#973, [critical]:
cpu_percent()may raiseZeroDivisionError.
5.1.2 — 2017-02-03
Bug fixes
#966, [Linux]:
sensors_battery()power_pluggedmay erroneously returnNoneon Python 3.#968, [Linux]:
disk_io_counters()raisesTypeErroron Python 3.#970, [Linux]:
sensors_battery()nameandlabelfields on Python 3 are bytes instead of str.
5.1.1 — 2017-02-03
Enhancements
#966, [Linux]:
sensors_battery()percentis a float and is more precise.
Bug fixes
#964, [Windows]:
Process.username()andusers()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 withFileNotFoundError.#966, [Linux]:
sensors_battery()power_pluggedmay lie.
5.1.0 — 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 returnsTrueif 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:
Popenwait()did not return the correct negative exit status if process is killed by a signal.#961, [Windows]:
WindowsService.description()method may fail withERROR_MUI_FILE_NOT_FOUND.
5.0.1 — 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()andcpu_times_percent()was calculated incorrectly asiowait,guestandguest_nicetimes were not properly taken into account.
5.0.0 — 2016-11-06
Note
psutil 5.0 introduces breaking API changes. See the migration guide if upgrading from 4.x.
Enhncements
#799: new
Process.oneshot()context manager (+2x faster in general, +2x to +6x on Windows).#943: better error message in case of version conflict on import.
Bug fixes
#932, [NetBSD]:
net_connections()andProcess.connections()may fail without raising an exception.#933, [Windows]: memory leak in
cpu_stats()andWindowsService.description()method.
4.4.2 — 2016-10-26
Bug fixes
#931, [critical]: psutil no longer compiles on Solaris.
4.4.1 — 2016-10-25
Bug fixes
4.4.0 — 2016-10-23
Enhancements
#874, [Windows]: make
net_if_addrs()also return thenetmask.#887, [Linux]:
virtual_memory()availableandusedare more precise and matchfreeutility. Also handles LXC containers.#891: scripts/procinfo.py 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 returnSTATUS_RUNNINGfor 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:
ValueErroris raised if a negative integer is passed tocpu_percent()functions.#892, [Linux], [critical]:
Process.cpu_affinity()with[-1]as arg raisesSystemErrorwith no error set; nowValueErroris raised.#906, [BSD]:
disk_partitions()withall=Falsereturned an empty list. Now the argument is ignored and all partitions are always returned.#907, [FreeBSD]:
Process.exe()may fail withOSErrorENOENT.#908, [macOS], [BSD]: different process methods could errounesuly mask the real error for high-privileged PIDs and raise
NoSuchProcessandAccessDeniedinstead ofOSErrorandRuntimeError.#909, [macOS]:
Process.open_files()andProcess.connections()methods may raiseOSErrorwith no exception set if process is gone.#916, [macOS]: fix many compilation warnings.
4.3.1 — 2016-09-01
Enhancements
#881:
make installnow works also when using a virtual env.
Bug fixes
#854:
Process.as_dict()raisesValueErrorif passed an erroneous attrs name.#857, [SunOS]:
Process.cpu_times(),Process.cpu_percent(),Process.threads()andProcess.memory_maps()may raiseRuntimeErrorif attempting to query a 64bit process with a 32bit Python. “Null” values are returned as a fallback.#858:
Process.as_dict()should not callProcess.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 raiseTimeoutExpiredwith wrong timeout unit (ms instead of sec).#870, [Windows]: handle leak inside
psutil_get_process_data.
4.3.0 — 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()raisesTypeErroron Python 3.#829, [POSIX]:
disk_usage()percentfield 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.
4.2.0 — 2016-05-14
Enhancements
#795, [Windows]: new APIs to deal with Windows services:
win_service_iter()andwin_service_get().#800, [Linux]:
virtual_memory()returns a newsharedfield.#819, [Linux]: speedup
/procparsing:Process.ppid()+20% faster.Process.status()+28% faster.Process.name()+25% faster.Process.num_threads()+20% faster on Python 3.
Bug fixes
#797, [Linux]:
net_if_stats()may raiseOSErrorfor certain NIC cards.#813:
Process.as_dict()should ignore extraneous attribute names which gets attached to theProcessinstance.
4.1.0 — 2016-03-12
Enhancements
#777, [Linux]:
Process.open_files()on Linux return 3 new fields:position,modeandflags.#779:
Process.cpu_times()returns two new fields,children_userandchildren_system(always set to 0 on macOS and Windows).#789, [Windows]:
cpu_times()return two new fields:interruptanddpc. Same forcpu_times_percent().#792: new
cpu_stats()function returning number of CPUctx_switches,interrupts,soft_interruptsandsyscalls.
Bug fixes
#774, [FreeBSD]:
net_io_counters()dropout is no longer set to 0 if the kernel provides it.#776, [Linux]:
Process.cpu_affinity()may erroneously raiseNoSuchProcess. (patch by @wxwright)#780, [macOS]: psutil does not compile with some GCC versions.
#786:
net_if_addrs()may report incomplete MAC addresses.#788, [NetBSD]:
virtual_memory()buffersandsharedvalues were set to 0.#790, [macOS], [critical]: psutil won’t compile on macOS 10.4.
4.0.0 — 2016-02-17
Enhancements
#523, [Linux], [FreeBSD]:
disk_io_counters()return a newbusy_timefield.#660, [Windows]: make.bat is smarter in finding alternative VS install locations. (patch by @mpderbec)
#732:
Process.environ(). (patch by Frank Benkstein)#753, [Linux], [macOS], [Windows]: process USS and PSS (Linux) “real” memory stats. (patch by Eric Rahm)
#755:
Process.memory_percent()memtypeparameter.#758: tests now live in psutil namespace.
#756, [Linux]:
disk_io_counters()return 2 new fields:read_merged_countandwrite_merged_count.#762: add scripts/procsmem.py.
Bug fixes
#685, [Linux]:
virtual_memory()provides wrong results on systems with a lot of physical memory.#704, [SunOS]: psutil does not compile on Solaris sparc.
#734: on Python 3 invalid UTF-8 data is not correctly handled for
Process.name(),Process.cwd(),Process.exe(),Process.cmdline()andProcess.open_files()methods resulting inUnicodeDecodeErrorexceptions.'surrogateescape'error handler is now used as a workaround for replacing the corrupted data.#737, [Windows]: when the bitness of psutil and the target process was different,
Process.cmdline()andProcess.cwd()could return a wrong result or incorrectly report anAccessDeniederror.#741, [OpenBSD]: psutil does not compile on mips64.
#751, [Linux]: fixed call to
Py_DECREFon possibleNULLobject.#754, [Linux]:
Process.cmdline()can be wrong in case of zombie process.#759, [Linux]:
Process.memory_maps()may return paths ending with" (deleted)".#761, [Windows]:
boot_time()wraps to 0 after 49 days.#764, [NetBSD]: fix compilation on NetBSD-6.x.
#766, [Linux]:
net_connections()can’t handle malformed/proc/net/unixfile.#767, [Linux]:
disk_io_counters()may raiseValueErroron 2.6 kernels and it’s broken on 2.4 kernels.#770, [NetBSD]:
disk_io_counters()metrics didn’t update.
3.4.2 — 2016-01-20
Enhancements
#728, [SunOS]: exposed
PROCFS_PATHconstant to change the default location of/procfilesystem.
Bug fixes
#724, [FreeBSD]:
virtual_memory()totalis incorrect.#730, [FreeBSD], [critical]:
virtual_memory()crashes with “OSError: [Errno 12] Cannot allocate memory”.
3.4.1 — 2016-01-15
Enhancements
#557, [NetBSD]: added NetBSD support. (contributed by Ryo Onodera and Thomas Klausner)
#708, [Linux]:
net_connections()andProcess.connections()on Python 2 can be up to 3x faster in case of many connections. AlsoProcess.memory_maps()is slightly faster.#718:
process_iter()is now thread safe.
Bug fixes
#714, [OpenBSD]:
virtual_memory()cachedvalue was always set to 0.#715, [critical]: don’t crash at import time if
cpu_times()fail for some reason.#717, [Linux]:
Process.open_files()fails if deleted files still visible.#722, [Linux]:
swap_memory()no longer crashes ifsin/soutcan’t be determined due to missing/proc/vmstat.#724, [FreeBSD]:
virtual_memory()totalis slightly incorrect.
3.3.0 — 2015-11-25
Enhancements
#558, [Linux]: exposed
PROCFS_PATHconstant to change the default location of/procfilesystem.#615, [OpenBSD]: added OpenBSD support. (contributed by Landry Breuil)
Bug fixes
#692, [POSIX]:
Process.name()is no longer cached as it may change.
3.2.2 — 2015-10-04
Bug fixes
#517, [SunOS]:
net_io_counters()failed to detect network interfaces correctly on Solaris 10#541, [FreeBSD]:
disk_io_counters()r/w times were expressed in seconds instead of milliseconds. (patch by dasumin)#610, [SunOS]: fix build and tests on Solaris 10
#623, [Linux]: process or system connections raises
ValueErrorif IPv6 is not supported by the system.#678, [Linux], [critical]: can’t install psutil due to bug in setup.py.
#688, [Windows]: compilation fails with MSVC 2015, Python 3.5. (patch by Mike Sarahan)
3.2.1 — 2015-09-03
Bug fixes
#677, [Linux], [critical]: can’t install psutil due to bug in setup.py.
3.2.0 — 2015-09-02
Enhancements
#644, [Windows]: added support for
CTRL_C_EVENTandCTRL_BREAK_EVENTsignals to use withProcess.send_signal().#663, [POSIX]:
net_if_addrs()now returns point-to-point (VPNs) addresses.#655, [Windows]: fix various unicode handling issues. On Python 2, string APIs now return encoded strings using
sys.getfilesystemencoding().
Bug fixes
#513, [Linux]: fixed integer overflow for
RLIM_INFINITY#641, [Windows]: fixed many compilation warnings. (patch by Jeff Tang)
#652, [Windows]:
net_if_addrs()UnicodeDecodeErrorin case of non-ASCII NIC names.#655, [Windows]:
net_if_stats()UnicodeDecodeErrorin case of non-ASCII NIC names.#659, [Linux]: compilation error on Suse 10. (patch by @maozguttman)
#664, [Linux]: compilation error on Alpine Linux. (patch by Bart van Kleef)
#670, [Windows]: segfgault of
net_if_addrs()in case of non-ASCII NIC names. (patch by sk6249)#672, [Windows]: compilation fails if using Windows SDK v8.0. (patch by Steven Winfield)
#675, [Linux]:
net_connections():UnicodeDecodeErrormay occur when listing UNIX sockets.
3.1.1 — 2015-07-15
Bug fixes
#603, [Linux]:
Process.ionice()set value range is incorrect. (patch by spacewander)#645, [Linux]:
cpu_times_percent()may produce negative results.#656:
from psutil import *does not work.
3.1.0 — 2015-07-15
Enhancements
#534, [Linux]:
disk_partitions()added support for ZFS filesystems.#646, [Windows]: continuous tests integration for Windows with https://ci.appveyor.com/project/giampaolo/psutil.
#647: new dev guide: https://github.com/giampaolo/psutil/blob/master/docs/devguide.rst
#651: continuous code quality test integration with scrutinizer-ci.com
Bug fixes
#340, [Windows], [critical]:
Process.open_files()no longer hangs (uses a thread with timeout). (patch by Jeff Tang)#627, [Windows]:
Process.name()no longer raisesAccessDeniedfor pids owned by another user.#636, [Windows]:
Process.memory_info()raiseAccessDenied.#637, [POSIX]: raise exception if trying to send signal to PID 0 as it will affect
os.getpid()‘s process group and not PID 0.#639, [Linux]:
Process.cmdline()can be truncated.#640, [Linux]:
*connectionsfunctions may swallow errors and return an incomplete list of connections.#642:
repr()of exceptions is incorrect.#653, [Windows]: add
inet_ntop()function for Windows XP to support IPv6.#641, [Windows]: replace deprecated string functions with safe equivalents.
3.0.1 — 2015-06-18
Bug fixes
#632, [Linux]: better error message if cannot parse process UNIX connections.
#634, [Linux]:
Process.cmdline()does not include empty string arguments.#635, [POSIX], [critical]: crash on module import if
enumpackage is installed on Python < 3.4.
3.0.0 — 2015-06-13
Enhancements
#250: new
net_if_stats()returning NIC statistics (isup,duplex,speed,mtu).#376: new
net_if_addrs()returning all NIC addresses a-laifconfig.#469: on Python >= 3.4
IOPRIO_CLASS_*and*_PRIORITY_CLASSconstants returned byProcess.ionice()andProcess.nice()are enums instead of plain integers.#581: add
.gitignore. (patch by Gabi Davar)#582: connection constants returned by
net_connections()andProcess.connections()were turned from int to enums on Python > 3.4.#587: move native extension into the package.
#589:
Process.cpu_affinity()accepts any kind of iterable (set, tuple, …), not only lists.#594: all deprecated APIs were removed.
#599, [Windows]:
Process.name()can now be determined for all processes even when running as a limited user.#602: pre-commit GIT hook.
#629: enhanced support for
pytestandnosetest runners.#616, [Windows]: add
inet_ntop()function for Windows XP.
Bug fixes
#428, [POSIX], [critical]: correct handling of zombie processes on POSIX. Introduced new
ZombieProcessexception class.#512, [BSD], [critical]: fix segfault in
net_connections().#555, [Linux]:
users()correctly handles":0"as an alias for"localhost".#579, [Windows]: fixed
Process.open_files()for PID > 64K.#579, [Windows]: fixed many compiler warnings.
#585, [FreeBSD]:
net_connections()may raiseKeyError.#586, [FreeBSD], [critical]:
Process.cpu_affinity()segfaults on set in case an invalid CPU number is provided.#593, [FreeBSD], [critical]:
Process.memory_maps()segfaults.#606:
Process.parent()may swallowNoSuchProcessexceptions.#611, [SunOS]:
net_io_counters()has send and received swapped#614, [Linux]::
cpu_count()withlogical=Falsereturn the number of sockets instead of cores.#618, [SunOS]: swap tests fail on Solaris when run as normal user.
#628, [Linux]:
Process.name()truncates string in case it contains spaces or parentheses.
2.2.1 — 2015-02-02
Bug fixes
#572, [Linux]: fix “ValueError: ambiguous inode with multiple PIDs references” for
Process.connections(). (patch by Bruno Binet)
2.2.0 — 2015-01-06
Enhancements
#521: drop support for Python 2.4 and 2.5.
#553: add scripts/pstree.py.
#564: C extension version mismatch is now detected at import time.
#568: add scripts/pidof.py.
#569, [FreeBSD]: add support for
Process.cpu_affinity()on FreeBSD.
Bug fixes
#496, [SunOS], [critical]: can’t import psutil.
#547, [POSIX]:
Process.username()may raiseKeyErrorif UID can’t be resolved.#551, [Windows]: get rid of the unicode hack for
net_io_counters()NIC names.#556, [Linux]: lots of file handles were left open.
#561, [Linux]:
net_connections()might skip some legitimate UNIX sockets. (patch by spacewander)#565, [Windows]: use proper encoding for
Process.username()andusers(). (patch by Sylvain Mouquet)#567, [Linux]: in the alternative implementation of
Process.cpu_affinity()PyList_AppendandPy_BuildValuereturn values are not checked.#569, [FreeBSD]: fix memory leak in
cpu_count()withlogical=False.#571, [Linux]:
Process.open_files()might swallowAccessDeniedexceptions and return an incomplete list of open files.
2.1.3 — 2014-09-26
#536, [Linux], [critical]: fix “undefined symbol: CPU_ALLOC” compilation error.
2.1.2 — 2014-09-21
Enhancements
#407: project moved from Google Code to Github; code moved from Mercurial to Git.
#492: use
toxto run tests on multiple Python versions. (patch by msabramo)#505, [Windows]: distribution as wheel packages.
#511: add scripts/ps.py.
Bug fixes
#340, [Windows]:
Process.open_files()no longer hangs. (patch by Jeff Tang)#501, [Windows]:
disk_io_counters()may return negative values.#503, [Linux]: in rare conditions
Process.exe(),Process.open_files()andProcess.connections()can raiseOSError(ESRCH)instead ofNoSuchProcess.#504, [Linux]: can’t build RPM packages via setup.py
#506, [Linux], [critical]: Python 2.4 support was broken.
#522, [Linux]:
Process.cpu_affinity()might returnEINVAL. (patch by David Daeschler)#529, [Windows]:
Process.exe()may raise unhandledWindowsErrorexception for PIDs 0 and 4. (patch by Jeff Tang)#530, [Linux]:
disk_io_counters()may crash on old Linux distros (< 2.6.5) (patch by Yaolong Huang)#533, [Linux]:
Process.memory_maps()may raiseTypeErroron old Linux distros.
2.1.1 — 2014-04-30
Bug fixes
#446, [Windows]: fix encoding error when using
net_io_counters()on Python 3. (patch by Szigeti Gabor Niif)#460, [Windows]:
net_io_counters()wraps after 4G.#491, [Linux]:
net_connections()exceptions. (patch by Alexander Grothe)
2.1.0 — 2014-04-08
Enhancements
#387: system-wide open connections a-la
netstat(addnet_connections()).
Bug fixes
#421, [SunOS], [critical]: psutil does not compile on SunOS 5.10. (patch by Naveed Roudsari)
#489, [Linux]:
disk_partitions()return an empty list.
2.0.0 — 2014-03-10
Enhancements
#424, [Windows]: installer for Python 3.X 64 bit.
#427: add
cpu_count().#447:
wait_procs()timeout parameter is now optional.#452: make
Processinstances hashable and usable withset()s.#453: tests on Python < 2.7 require
unittest2module.#459: add a Makefile for running tests and other repetitive tasks (also on Windows).
#463: make timeout parameter of
cpu_percent*functions default to0.0‘cause it’s a common trap to introduce slowdowns.#468: move documentation to readthedocs.com.
#477:
Process.cpu_percent()is about 30% faster. (suggested by crusaderky)#478, [Linux]: almost all APIs are about 30% faster on Python 3.X.
#479: long deprecated
psutil.errormodule is gone; exception classes now live in psutil namespace only.
Bug fixes
#193:
Popenconstructor can throw an exception if the spawned process terminates quickly.#340, [Windows]:
Process.open_files()no longer hangs. (patch by jtang@vahna.net)#443, [Linux]: fix a potential overflow issue for
Process.cpu_affinity()(set) on systems with more than 64 CPUs.#448, [Windows]:
Process.children()andProcess.ppid()memory leak (patch by Ulrich Klank).#457, [POSIX]:
pid_exists()always returnsTruefor PID 0.#461: named tuples are not pickle-able.
#466, [Linux]:
Process.exe()improper null bytes handling. (patch by Gautam Singh)#470:
wait_procs()might not wait. (patch by @crusaderky)#471, [Windows]:
Process.exe()improper unicode handling. (patch by alex@mroja.net)#473:
Popenwait()method does not setreturncodeattribute.#474, [Windows]:
Process.cpu_percent()is no longer capped at 100%.#476, [Linux]: encoding error for
Process.name()andProcess.cmdline().
API changes
For the sake of consistency a lot of psutil APIs have been renamed. In most
cases accessing the old names will work but it will cause a
DeprecationWarning.
psutil.*module level constants have being replaced by functions:Old name
Replacement
psutil.NUM_CPUS
psutil.cpu_count()
psutil.BOOT_TIME
psutil.boot_time()
psutil.TOTAL_PHYMEM
virtual_memory.total
Renamed
psutil.*functions:Old name
Replacement
psutil.get_pid_list()
psutil.pids()
psutil.get_users()
psutil.users()
psutil.get_boot_time()
psutil.boot_time()
All
Processget_*methods lost theget_prefix. E.g.get_ext_memory_info()was renamed tomemory_info_ex(). Assumingp = psutil.Process():Old name
Replacement
p.get_children()
p.children()
p.get_connections()
p.connections()
p.get_cpu_affinity()
p.cpu_affinity()
p.get_cpu_percent()
p.cpu_percent()
p.get_cpu_times()
p.cpu_times()
p.get_ext_memory_info()
p.memory_info_ex()
p.get_io_counters()
p.io_counters()
p.get_ionice()
p.ionice()
p.get_memory_info()
p.memory_info()
p.get_memory_maps()
p.memory_maps()
p.get_memory_percent()
p.memory_percent()
p.get_nice()
p.nice()
p.get_num_ctx_switches()
p.num_ctx_switches()
p.get_num_fds()
p.num_fds()
p.get_num_threads()
p.num_threads()
p.get_open_files()
p.open_files()
p.get_rlimit()
p.rlimit()
p.get_threads()
p.threads()
p.getcwd()
p.cwd()
All
Processset_*methods lost theset_prefix. Assumingp = psutil.Process():Old name
Replacement
p.set_nice()
p.nice(value)
p.set_ionice()
p.ionice(ioclass, value=None)
p.set_cpu_affinity()
p.cpu_affinity(cpus)
p.set_rlimit()
p.rlimit(resource, limits=None)
Except for
pid, allProcessclass properties have been turned into methods. This is the only case which there are no aliases. Assumingp = psutil.Process():Old name
Replacement
p.name
p.name()
p.parent
p.parent()
p.ppid
p.ppid()
p.exe
p.exe()
p.cmdline
p.cmdline()
p.status
p.status()
p.uids
p.uids()
p.gids
p.gids()
p.username
p.username()
p.create_time
p.create_time()
timeout parameter of
cpu_percent*functions defaults to 0.0 instead of 0.1.long deprecated
psutil.errormodule is gone; exception classes now live in “psutil” namespace only.Processinstances’retcodeattribute returned bywait_procs()has been renamed toreturncodefor consistency withsubprocess.Popen.
1.2.1 — 2013-11-25
Bug fixes
#348, [Windows], [critical]: fixed “ImportError: DLL load failed” occurring on module import on Windows XP.
#425, [SunOS], [critical]: crash on import due to failure at determining
BOOT_TIME.#443, [Linux]:
Process.cpu_affinity()can’t set affinity on systems with more than 64 cores.
1.2.0 — 2013-11-20
Enhancements
#439: assume
os.getpid()if no argument is passed toProcessclass constructor.#440: new
wait_procs()utility function which waits for multiple processes to terminate.
Bug fixes
#348, [Windows]: fix “ImportError: DLL load failed” occurring on module import on Windows XP / Vista.
1.1.3 — 2013-11-07
Bug fixes
#442, [Linux], [critical]: psutil won’t compile on certain version of Linux because of missing prlimit(2) syscall.
1.1.2 — 2013-10-22
Bug fixes
#442, [Linux], [critical]: psutil won’t compile on Debian 6.0 because of missing prlimit(2) syscall.
1.1.1 — 2013-10-08
Bug fixes
#442, [Linux], [critical]: psutil won’t compile on kernels < 2.6.36 due to missing prlimit(2) syscall.
1.1.0 — 2013-09-28
Enhancements
#410: host tar.gz and Windows binary files are on PyPI.
#412, [Linux]: add
Process.rlimit().#415, [Windows]:
Process.children()is an order of magnitude faster.#426, [Windows]:
Process.name()is an order of magnitude faster.#431, [POSIX]:
Process.name()is slightly faster because it unnecessarily retrieved alsoProcess.cmdline().
Bug fixes
#391, [Windows]:
cpu_times_percent()returns negative percentages.#408:
STATUS_*andCONN_*constants don’t properly serialize on JSON.#411, [Windows]: scripts/disk_usage.py may pop-up a GUI error.
#413, [Windows]:
Process.memory_info()leaks memory.#414, [Windows]:
Process.exe()on Windows XP may raiseERROR_INVALID_PARAMETER.#416:
disk_usage()doesn’t work well with unicode path names.#430, [Linux]:
Process.io_counters()report wrong number of r/w syscalls.#435, [Linux]:
net_io_counters()might report erreneous NIC names.#436, [Linux]:
net_io_counters()reports a wrongdropinvalue.
API changes
#408: turn
STATUS_*andCONN_*constants into plain Python strings.
1.0.1 — 2013-07-12
Bug fixes
#405:
net_io_counters()pernic=Trueno longer works as intended in 1.0.0.
1.0.0 — 2013-07-10
Enhancements
#18, [SunOS]: add Solaris support (yay!) (thanks Justin Venus)
#367:
Process.connections()statusstrings are now constants.#380: test suite exits with non-zero on failure. (patch by floppymaster)
#391: introduce unittest2 facilities and provide workarounds if unittest2 is not installed (Python < 2.7).
Bug fixes
#374, [Windows]: negative memory usage reported if process uses a lot of memory.
#379, [Linux]:
Process.memory_maps()may raiseValueError.#394, [macOS]: mapped memory regions of
Process.memory_maps()report incorrect file name.#404, [Linux]:
sched_*affinity()are implicitly declared. (patch by Arfrever)
API changes
Process.connections()statusfield is no longer a string but a constant object (psutil.CONN_*).Process.connections()local_addressandremote_addressfields renamed toladdrandraddr.psutil.network_io_counters() renamed to
net_io_counters().
0.7.1 — 2013-05-03
Bug fixes
#325, [BSD], [critical]:
virtual_memory()can raiseSystemError. (patch by Jan Beich)#370, [BSD]:
Process.connections()requires root. (patch by John Baldwin)#372, [BSD]: different process methods raise
NoSuchProcessinstead ofAccessDenied.
0.7.0 — 2013-04-12
Enhancements
#233: code migrated to Mercurial (yay!)
#246: psutil.error module is deprecated and scheduled for removal.
#328, [Windows]:
Process.ionice()support.#359: add
boot_time()as a substitute ofpsutil.BOOT_TIMEsince the latter cannot reflect system clock updates.#361, [Linux]:
cpu_times()now includes newsteal,guestandguest_nicefields available on recent Linux kernels. Also,cpu_percent()is more accurate.#362: add
cpu_times_percent()(per-CPU-time utilization as a percentage).
Bug fixes
#234, [Windows]:
disk_io_counters()fails to list certain disks.#264, [Windows]: use of
disk_partitions()may cause a message box to appear.#313, [Linux], [critical]:
virtual_memory()andswap_memory()can crash on certain exotic Linux flavors having an incomplete/procinterface. If that’s the case we now set the unretrievable stats to0and raiseRuntimeWarninginstead.#315, [macOS]: fix some compilation warnings.
#317, [Windows]: cannot set process CPU affinity above 31 cores.
#319, [Linux]:
Process.memory_maps()raisesKeyError‘Anonymous’ on Debian squeeze.#321, [POSIX]:
Process.ppid()property is no longer cached as the kernel may set the PPID to 1 in case of a zombie process.#323, [macOS]:
disk_io_counters()read_timeandwrite_timeparameters were reporting microseconds not milliseconds. (patch by Gregory Szorc)#331:
Process.cmdline()is no longer cached after first access as it may change.#337, [Linux], [critical]:
Processmethods not working because of a poor/procimplementation will raiseNotImplementedErrorrather thanRuntimeErrorandProcess.as_dict()will not blow up. (patch by Curtin1060)#338, [Linux]:
disk_io_counters()fails to find some disks.#339, [FreeBSD]:
get_pid_list()can allocate all the memory on system.#341, [Linux], [critical]: psutil might crash on import due to error in retrieving system terminals map.
#344, [FreeBSD]:
swap_memory()might return incorrect results due tokvm_open(3)not being called. (patch by Jean Sebastien)#338, [Linux]:
disk_io_counters()fails to find some disks.#351, [Windows]: if psutil is compiled with MinGW32 (provided installers for py2.4 and py2.5 are)
disk_io_counters()will fail. (Patch by m.malycha)#356:
Process.parent()now checks whether parent PID has been reused in which case returnsNone.#365:
Process.nice()(set) should check PID has not been reused by another process.#366, [FreeBSD], [critical]:
Process.memory_maps(),Process.num_fds(),Process.open_files()andProcess.cwd()methods raiseRuntimeErrorinstead ofAccessDenied.
API changes
Process.cmdline()property is no longer cached after first access.Process.ppid()property is no longer cached after first access.[Linux]
Processmethods not working because of a poor/procimplementation will raiseNotImplementedErrorinstead ofRuntimeError.psutil.errormodule is deprecated and scheduled for removal.
0.6.1 — 2012-08-16
Enhancements
#316:
Process.cmdline()property now makes a better job at guessing the process executable from the cmdline.
Bug fixes
#316:
Process.exe()was resolved in case it was a symlink.#318, [critical]: Python 2.4 compatibility was broken.
API changes
Process.exe()can now return an empty string instead of raisingAccessDenied.Process.exe()is no longer resolved in case it’s a symlink.
0.6.0 — 2012-08-13
Enhancements
#216, [POSIX]: add
Process.connections()UNIX sockets support.#220, [FreeBSD]:
net_connections()has been rewritten in C and no longer requireslsof.#222, [macOS]: add support for
Process.cwd().#261: add
Process.memory_info_ex().#295, [macOS]:
Process.exe()path is now determined by asking the OS instead of being guessed fromProcess.cmdline().#297, [macOS]:
Process.name(),Process.memory_info(),Process.memory_percent(),Process.cpu_times(),Process.cpu_percent(),Process.num_threads()no longer raiseAccessDeniedfor other users’ processes and are 2.5x faster.#300: add scripts/pmap.py.
#301:
process_iter()now yields processes sorted by their PIDs.#303, [Windows]:
Process.create_time(),Process.cpu_times(),Process.cpu_percent(),Process.memory_info(),Process.memory_percent(),Process.num_handles(),Process.io_counters()no longer raiseAccessDeniedfor other users’ processes.#305: add scripts/netstat.py.
#311: add
virtual_memory()andswap_memory(). Old memory-related functions are deprecated. New example scripts: scripts/free.py and scripts/meminfo.py.#312:
net_io_counters()adds 4 new fields:errin,errout,dropinanddropout.
Bug fixes
#298, [macOS], [BSD]: memory leak in
Process.num_fds().#299: potential memory leak every time
PyList_New(0)is used.#303, [Windows], [critical]: potential heap corruption in
Process.num_threads()andProcess.status()methods.#305, [FreeBSD], [critical]: can’t compile on FreeBSD 9 due to removal of
utmp.h.#306, [critical]: at C level, errors are not checked when invoking
Py*functions which create or manipulate Python objects leading to potential memory related errors and/or segmentation faults.#307, [FreeBSD]: values returned by
net_io_counters()are wrong.#308, [BSD], [Windows]:
psutil.virtmem_usage()wasn’t actually returning information about swap memory usage as it was supposed to do. It does now.#309:
Process.open_files()might not return files which can not be accessed due to limited permissions.AccessDeniedis now raised instead.
API changes
psutil.phymem_usage()is deprecated (usevirtual_memory())psutil.virtmem_usage()is deprecated (useswap_memory())[Linux]:
psutil.phymem_buffers()is deprecated (usevirtual_memory())[Linux]:
psutil.cached_phymem()is deprecated (usevirtual_memory())[Windows], [BSD]:
psutil.virtmem_usage()now returns information about swap memory instead of virtual memory.
0.5.1 — 2012-06-29
Enhancements
#293, [Windows]:
Process.exe()path is now determined by asking the OS instead of being guessed fromProcess.cmdline().
Bug fixes
#292, [Linux]: race condition in process
Process.open_files(),Process.connections(),Process.threads().#294, [Windows]:
Process.cpu_affinity()is only able to set CPU #0.
0.5.0 — 2012-06-27
Enhancements
#195, [Windows]: add
Process.num_handles().#209:
disk_partitions()now provides also mount options.#238, [Linux], [Windows]: add
Process.cpu_affinity().#242: add
recursive=TruetoProcess.children(): return all process descendants.#245, [POSIX]:
Process.wait()incrementally consumes less CPU cycles.#257, [Windows]: removed Windows 2000 support.
#258, [Linux]:
Process.memory_info()is now 0.5x faster.#260: add
Process.memory_maps(). (Windows patch by @wj32, macOS patch by Jeremy Whitlock)#262, [Windows]:
disk_partitions()was slow due to inspecting the floppy disk drive also when parameter isall=False.#273:
psutil.get_process_list()is deprecated.#274: psutil no longer requires
2to3at installation time in order to work with Python 3.#278: add
Process.as_dict().#281:
Process.ppid(),Process.name(),Process.exe(),Process.cmdline()andProcess.create_time()are now cached after first access.#282:
psutil.STATUS_*constants can now be compared by using their string representation.#283: speedup
Process.is_running()by caching its return value in case the process is terminated.#284, [POSIX]: add
Process.num_fds().#287:
process_iter()now cachesProcessinstances between calls.#290:
Process.nice()property is deprecated in favor of newget_nice()andset_nice()methods.
Bug fixes
#193:
Popenconstructor can throw an exception if the spawned process terminates quickly.#240, [macOS]: incorrect use of
free()forProcess.connections().#244, [POSIX]:
Process.wait()can hog CPU resources if called against a process which is not our children.#248, [Linux]:
net_io_counters()might return erroneous NIC names.#252, [Windows]:
Process.cwd()erroneously raiseNoSuchProcessfor processes owned by another user. It now raisesAccessDeniedinstead.#266, [Windows]:
psutil.get_pid_list()only shows 1024 processes. (patch by @amoser)#267, [macOS]:
Process.connections()returns wrong remote address. (Patch by Amoser)#272, [Linux]:
Process.open_files()potential race condition can lead to unexpectedNoSuchProcessexception. Also, we can get incorrect reports of not absolutized path names.#275, [Linux]:
Process.io_counters()erroneously raiseNoSuchProcesson old Linux versions. Where not available it now raisesNotImplementedError.#286:
Process.is_running()doesn’t actually check whether PID has been reused.#314:
Process.children()can sometimes return non-children.
API changes
Process.niceproperty is deprecated in favor of newget_nice()andset_nice()methods.psutil.get_process_list()is deprecated.Process.ppid(),Process.name(),Process.exe(),Process.cmdline()andProcess.create_time()properties ofProcessclass are now cached after being accessed, meaningNoSuchProcesswill no longer be raised in case the process is gone in the meantime.psutil.STATUS_*constants can now be compared by using their string representation.
0.4.1 — 2011-12-14
Bug fixes
#228: some example scripts were not working with Python 3.
#230, [Windows], [macOS]: fix memory leak in
Process.connections().#232, [Linux]:
psutil.phymem_usage()can report erroneous values which are different thanfreecommand.#236, [Windows]: fix memory/handle leak in
Process.memory_info(),Process.suspend()andProcess.resume()methods.
0.4.0 — 2011-10-29
Enhancements
#150: add
net_io_counters()(macOS and Windows patch by Jeremy Whitlock)#154, [FreeBSD]: add support for
Process.cwd().#157, [Windows]: provide installer for Python 3.2 64-bit.
#198:
Process.wait()withtimeout=0can now be used to make the function return immediately.#206: add
disk_io_counters()). (macOS and Windows patch by Jeremy Whitlock)#213: add scripts/iotop.py.
#217:
Process.connections()now has a kind argument to filter for connections with different criteria.#221, [FreeBSD]:
Process.open_files()has been rewritten in C and no longer relies onlsof.#223: add scripts/top.py.
#227: add scripts/nettop.py.
Bug fixes
#144, [Linux]: no longer support 0 special PID.
#188, [Linux]: psutil import error on Linux ARM architectures.
#194, [POSIX]:
Process.cpu_percent()now reports a percentage over 100 on multi core processors.#197, [Linux]:
Process.connections()is broken on platforms not supporting IPv6.#200, [Linux], [critical]:
psutil.NUM_CPUSnot working on armel and sparc architectures and causing crash on module import.#201, [Linux]:
Process.connections()is broken on big-endian architectures.#211:
Processinstance can unexpectedly raiseNoSuchProcessif tested for equality with another object.#218, [Linux], [critical]: crash at import time on Debian 64-bit because of a missing line in
/proc/meminfo.#226, [FreeBSD], [critical]: crash at import time on FreeBSD 7 and minor.
0.3.0 — 2011-07-08
Enhancements
#125: add
cpu_times()andcpu_percent()per-cpu support.#163: add
Process.terminal().#171: add
get_phymem()andget_virtmem(). Oldtotal_*,avail_*andused_*memory functions are deprecated.#172: add
disk_usage().#174: add
disk_partitions().#179: setuptools is now used in setup.py
Bug fixes
#159, [Windows]:
SetSeDebug()does not close handles or unset impersonation on return.#164, [Windows]:
Process.wait()raises aTimeoutExceptionwhen a process returns-1.#165:
Process.status()raises an unhandled exception.#166:
Process.memory_info()leaks handles hogging system resources.#168:
cpu_percent()returns erroneous results when used in non-blocking mode. (patch by Philip Roberts)#178, [macOS]:
Process.threads()leaks memory.#180, [Windows]:
Process.num_threads()andProcess.threads()methods can raiseNoSuchProcessexception while process still exists.
0.2.1 — 2011-03-20
Enhancements
#64: add
Process.io_counters().#116: add
Process.wait().#134: add
Process.threads().#136:
Process.exe()path on FreeBSD is now determined by asking the kernel instead of guessing it from cmdline[0].#137: add
Process.uids()andProcess.gids().#140: add
boot_time().#142: add
Process.nice().#143: add
Process.status().#147 [Linux]: add
Process.ionice().#148: add
Popenclass combiningsubprocess.PopenandProcessin a single interface.#152, [macOS]:
Process.open_files()rewritten in C (no longer relies onlsof, 3x faster).#153, [macOS]:
Process.connections()rewritten in C (no longer relies onlsof, 3x faster).
Bug fixes
#83, [macOS]:
Process.cmdline()is empty on macOS 64-bit.#130, [Linux]: a race condition can cause
IOErrorexception be raised on if process disappears betweenopen()and the subsequentread()call.#145, [Windows], [critical]:
WindowsErrorwas raised instead ofAccessDeniedwhen usingProcess.resume()orProcess.suspend().#146, [Linux]:
Process.exe()property can raiseTypeErrorif path contains NULL bytes.#151, [Linux]:
Process.exe()andProcess.cwd()for PID 0 return inconsistent data.
API changes
Processuidandgidproperties are deprecated in favor ofuidsandgidsproperties.
0.2.0 — 2010-11-13
Enhancements
#79: add
Process.open_files().#88: total system physical cached memory.
#88: total system physical memory buffers used by the kernel.
#91: add
Process.send_signal()andProcess.terminate()methods.#95:
NoSuchProcessandAccessDeniedexception classes now providepid,nameandmsgattributes.#97: add
Process.children().#98:
Process.cpu_times()andProcess.memory_info()now return a named tuple instead of a tuple.#103: add
Process.connections().#107, [Windows]: add support for Windows 64 bit. (patch by cjgohlke)
#111: add
Process.exe().#113: exception messages now include
Process.name()andProcess.pid.#114, [Windows]:
Process.username()rewritten in C (no longer uses WMI, much faster, pywin32 no longer required). (patch by @wj32)#117, [Windows]: added support for Windows 2000.
#123:
cpu_percent()andProcess.cpu_percent()accept a new interval parameter.#129: add
Process.threads().
Bug fixes
#80: fixed warnings when installing psutil with easy_install.
#81, [Windows]: psutil fails to compile with Visual Studio.
#94:
Process.suspend()raisesOSErrorinstead ofAccessDenied.#86, [FreeBSD]: psutil didn’t compile against FreeBSD 6.x.
#102, [Windows]: orphaned process handles obtained by using
OpenProcessin C were left behind every timeProcessclass was instantiated.#111, [POSIX]:
pathandnameProcessproperties report truncated or erroneous values on POSIX.#120, [macOS]:
cpu_percent()always returning 100%.#112:
uidandgidproperties don’t change if process changes effective user/group id at some point.#126:
Process.ppid(),Process.uids(),Process.gids(),Process.name(),Process.exe(),Process.cmdline()andProcess.create_time()properties are no longer cached and correctly raiseNoSuchProcessexception if the process disappears.
API changes
psutil.Process.pathproperty is deprecated and works as an alias forpsutil.Process.exeproperty.Process.kill(): signal argument was removed - to send a signal to the process useProcess.send_signal()method instead.Process.memory_info()returns a named tuple instead of a tuple.cpu_times()returns a named tuple instead of a tuple.Add
Process.open_files(),Process.connections(),Process.send_signal()andProcess.terminate().Process.ppid(),Process.uids(),Process.gids(),Process.name(),Process.exe(),Process.cmdline()andProcess.create_time()properties are no longer cached and raiseNoSuchProcessexception if process disappears.cpu_percent()no longer returns immediately (see #123).Process.cpu_percent()andcpu_percent()no longer returns immediately by default (see #123).
0.1.3 — 2010-03-02
Enhancements
#51, [Linux], [Windows]: add
Process.cwd().#59:
Process.is_running()is now 10 times faster.#61, [FreeBSD]: added support for FreeBSD 64 bit.
#71: add
Process.suspend()andProcess.resume().#75: Python 3 support.
Bug fixes
#36:
Process.cpu_times()andProcess.memory_info()functions succeeded. also for dead processes while aNoSuchProcessexception is supposed to be raised.#48, [FreeBSD]: incorrect size for MIB array defined in
getcmdargs.#49, [FreeBSD]: possible memory leak due to missing
free()on error condition ingetcmdpath().#50, [BSD]: fixed
getcmdargs()memory fragmentation.#55, [Windows]:
test_pid_4was failing on Windows Vista.#57: some unit tests were failing on systems where no swap memory is available.
#58:
Process.is_running()is now called beforeProcess.kill()to make sure we are going to kill the correct process.#73, [macOS]: virtual memory size reported on includes shared library size.
#77:
NoSuchProcesswasn’t raised onProcess.create_time()ifProcess.kill()was used first.
0.1.2 — 2009-05-06
Enhancements
#32: add
Process.cpu_times().#33: add
Process.create_time().#34: add
Process.cpu_percent().#38: add
Process.memory_info().#41: add
Process.memory_percent().#39: add
boot_time().#43: Total system virtual memory.
#46: Total system physical memory.
#44: Total system used/free virtual and physical memory.
Bug fixes
#36, [Windows]:
NoSuchProcessnot raised when accessing timing methods.#40, [FreeBSD], [macOS]: fix
test_get_cpu_timesfailures.#42, [Windows]:
Process.memory_percent()raisesAccessDenied.
0.1.1 — 2009-03-06
Enhancements
#4, [FreeBSD]: support for all functions of psutil.
#9, [macOS], [Windows]: add
Process.uidandProcess.gid, returning process UID and GID.#11: per-process parent object:
Process.parent()property returns aProcessobject representing the parent process, andProcess.ppid()returns the parent PID.#12, #15:
NoSuchProcessexception now raised when creating an object for a nonexistent process, or when retrieving information about a process that has gone away.#21, [Windows]:
AccessDeniedexception created for raising access denied errors fromOSErrororWindowsErroron individual platforms.#26:
process_iter()function to iterate over processes asProcessobjects with a generator.Processobjects can now also be compared with == operator for equality (PID, name, command line are compared).
Bug fixes
#16, [Windows]: Special case for “System Idle Process” (PID 0) which otherwise would return an “invalid parameter” exception.
#17:
get_process_list()ignoresNoSuchProcessandAccessDeniedexceptions during building of the list.#22, [Windows]:
Process.kill()for PID 0 was failing with an unset exception.#23, [Linux], [macOS]: create special case for
pid_exists()with PID 0.#24, [Windows], [critical]:
Process.kill()for PID 0 now raisesAccessDeniedexception instead ofWindowsError.#30: psutil.get_pid_list() was returning two 0 PIDs.