Skip to content
Permalink
master
Switch branches/tags
Go to file
Latest commit 992dfe4 May 20, 2022 History
36 contributors

Users who have contributed to this file

@giampaolo @jomann09 @mrjefftang @sebrestin @grobian @0-wiz-0 @sataloger @prlw1 @PierreF @mx-psi @nradchenko @nicolargo

Bug tracker at https://github.com/giampaolo/psutil/issues

5.9.1

2022-05-20

Enhancements

  • 1053: drop Python 2.6 support. (patches by Matthieu Darbois and Hugo van Kemenade)
  • 2050, [Linux]: increase read(2) buffer size from 1k to 32k when reading /proc pseudo files line by line. This should help having more consistent results.
  • 2057, [OpenBSD]: add support for cpu_freq().
  • 2107, [Linux]: Process.memory_full_info() (reporting process USS/PSS/Swap memory) now reads /proc/pid/smaps_rollup instead of /proc/pids/smaps, which makes it 5 times faster.

Bug fixes

  • 2048: AttributeError is raised if psutil.Error class is raised manually and passed through str.
  • 2049, [Linux]: cpu_freq() erroneously returns curr value in GHz while min and max are in MHz.
  • 2050, [Linux]: virtual_memory() may raise ValueError if running in a LCX container.

5.9.0

2021-12-29

Enhancements

  • 1851, [Linux]: cpu_freq() is slow on systems with many CPUs. Read current frequency values for all CPUs from /proc/cpuinfo instead of opening many files in /sys fs. (patch by marxin)
  • 1992: NoSuchProcess message now specifies if the PID has been reused.
  • 1992: error classes (NoSuchProcess, AccessDenied, etc.) now have a better formatted and separated __repr__ and __str__ implementations.
  • 1996, [BSD]: add support for MidnightBSD. (patch by Saeed Rasooli)
  • 1999, [Linux]: disk_partitions(): convert /dev/root device (an alias used on some Linux distros) to real root device path.
  • 2005: PSUTIL_DEBUG mode now prints file name and line number of the debug messages coming from C extension modules.
  • 2042: rewrite HISTORY.rst to use hyperlinks pointing to psutil API doc.

Bug fixes

  • 1456, [macOS], [critical]: cpu_freq() min and max are set to 0 if can't be determined (instead of crashing).
  • 1512, [macOS]: sometimes Process.connections() will crash with EOPNOTSUPP for one connection; this is now ignored.
  • 1598, [Windows]: disk_partitions() only returns mountpoints on drives where it first finds one.
  • 1874, [SunOS]: swap output error due to incorrect range.
  • 1892, [macOS]: cpu_freq() broken on Apple M1.
  • 1901, [macOS]: different functions, especially Process.open_files() and Process.connections(), could randomly raise AccessDenied because the internal buffer of proc_pidinfo(PROC_PIDLISTFDS) syscall was not big enough. We now dynamically increase the buffer size until it's big enough instead of giving up and raising AccessDenied, which was a fallback to avoid crashing.
  • 1904, [Windows]: OpenProcess fails with ERROR_SUCCESS due to GetLastError() called after sprintf(). (patch by alxchk)
  • 1913, [Linux]: wait_procs() should catch subprocess.TimeoutExpired exception.
  • 1919, [Linux]: sensors_battery() can raise TypeError on PureOS.
  • 1921, [Windows]: swap_memory() shows committed memory instead of swap.
  • 1940, [Linux]: psutil does not handle ENAMETOOLONG when accessing process file descriptors in procfs. (patch by Nikita Radchenko)
  • 1948, [critical]: memoize_when_activated decorator is not thread-safe. (patch by Xuehai Pan)
  • 1953, [Windows], [critical]: disk_partitions() crashes due to insufficient buffer len. (patch by MaWe2019)
  • 1965, [Windows], [critical]: fix "Fatal Python error: deallocating None" when calling users() multiple times.
  • 1980, [Windows]: 32bit / WoW64 processes fails to read Process.name() longer than 128 characters resulting in AccessDenied. This is now fixed. (patch by PetrPospisil)
  • 1991, [critical]: process_iter() is not thread safe and can raise TypeError if invoked from multiple threads.
  • 1956, [macOS]: Process.cpu_times() reports incorrect timings on M1 machines. (patch by Olivier Dormond)
  • 2023, [Linux]: cpu_freq() return order is wrong on systems with more than 9 CPUs.

5.8.0

2020-12-19

Enhancements

  • 1863: disk_partitions() exposes 2 extra fields: maxfile and maxpath, which are the maximum file name and path name length.
  • 1872, [Windows]: added support for PyPy 2.7.
  • 1879: provide pre-compiled wheels for Linux and macOS (yey!).
  • 1880: get rid of Travis and Cirrus CI services (they are no longer free). CI testing is now done by GitHub Actions on Linux, macOS and FreeBSD (yes). AppVeyor is still being used for Windows CI.

Bug fixes

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() isup also checks whether the NIC is running (meaning Wi-Fi or ethernet cable is connected). (patch by Chris Burger)
  • 1837, [Linux]: improved battery detection and charge secsleft calculation (patch by aristocratos)

Bug fixes

  • 1620, [Linux]: cpu_count() with logical=False result is incorrect on systems with more than one CPU socket. (patch by Vincent A. Arcila)
  • 1738, [macOS]: Process.exe() may raise FileNotFoundError if process is still alive but the exe file which launched it got deleted.
  • 1791, [macOS]: fix missing include for getpagesize().
  • 1823, [Windows], [critical]: Process.open_files() may cause a segfault due to a NULL pointer.
  • 1838, [Linux]: sensors_battery(): if percent can be determined but not the remaining values, still return a result instead of None. (patch by aristocratos)

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 build now runs in parallel on Python >= 3.6 and it's about 15% faster.
  • 1747: Process.wait() return value is cached so that the exit code can be retrieved on then next call.
  • 1747, [POSIX]: Process.wait() on POSIX now returns an enum, showing the negative signal which was used to terminate the process. It returns something like <Negsignal.SIGTERM: -15>.
  • 1747: Process class provides more info about the process on str() and repr() (status and exit code).
  • 1757: memory leak tests are now stable.
  • 1768, [Windows]: added support for Windows Nano Server. (contributed by Julien Lebot)

Bug fixes

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 raising AccessDenied).
  • 1679, [Windows]: net_connections() and Process.connections() are 10% faster.
  • 1682, [PyPy]: added CI / test integration for PyPy via Travis.
  • 1686, [Windows]: added support for PyPy on Windows.
  • 1693, [Windows]: boot_time(), Process.create_time() and users()'s login time now have 1 micro second precision (before the precision was of 1 second).

Bug fixes

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 takes into account misbehaving processes renaming the command line and using inappropriate chars to separate args.
  • 1616, [critical]: use of Py_DECREF instead of Py_CLEAR will result in double free() and segfault (CVE-2019-18874). (patch by Riccardo Schirone)
  • 1619, [OpenBSD], [critical]: compilation fails due to C syntax error. (patch by Nathan Houghton)

5.6.5

2019-11-06

Bug fixes

  • 1615: remove pyproject.toml as it was causing installation issues.

5.6.4

2019-11-04

Enhancements

  • 1527, [Linux]: added Process.cpu_times() iowait counter, which is the time spent waiting for blocking I/O to complete.
  • 1565: add PEP 517/8 build backend and requirements specification for better pip integration. (patch by Bernát Gábor)

Bug fixes

  • 875, [Windows], [critical]: Process.cmdline(), Process.environ() or Process.cwd() may occasionally fail with ERROR_PARTIAL_COPY which now gets translated to AccessDenied.
  • 1126, [Linux], [critical]: Process.cpu_affinity() segfaults on CentOS 5 / manylinux. Process.cpu_affinity() support for CentOS 5 was removed.
  • 1528, [AIX], [critical]: compilation error on AIX 7.2 due to 32 vs 64 bit differences. (patch by Arnon Yaari)
  • 1535: type and family fields returned by net_connections() are not always turned into enums.
  • 1536, [NetBSD]: Process.cmdline() erroneously raise ZombieProcess error if cmdline has non encodable chars.
  • 1546: usage percent may be rounded to 0 on Python 2.
  • 1552, [Windows]: getloadavg() math for calculating 5 and 15 mins values is incorrect.
  • 1568, [Linux]: use CC compiler env var if defined.
  • 1570, [Windows]: NtWow64* syscalls fail to raise the proper error code
  • 1585, [OSX]: avoid calling close() (in C) on possible negative integers. (patch by Athos Ribeiro)
  • 1606, [SunOS], [critical]: compilation fails on SunOS 5.10. (patch by vser1)

5.6.3

2019-06-11

Enhancements

Bug fixes

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() with logical=False uses a second method (read from /sys/devices/system/cpu/cpu[0-9]/topology/core_id) in order to determine the number of CPU cores in case /proc/cpuinfo does not provide this info.
  • 1458: provide coloured test output. Also show failures on KeyboardInterrupt.
  • 1464: various docfixes (always point to Python 3 doc, fix links, etc.).
  • 1476, [Windows]: it is now possible to set process high I/O priority (Process.ionice()). Also, I/O priority values are now exposed as 4 new constants: IOPRIO_VERYLOW, IOPRIO_LOW, IOPRIO_NORMAL, IOPRIO_HIGH.
  • 1478: add make command to re-run tests failed on last run.

Bug fixes

  • 1223, [Windows]: boot_time() may return incorrect value on Windows XP.
  • 1456, [Linux]: cpu_freq() returns None instead of 0.0 when min and max fields can't be determined. (patch by Alex Manuskin)
  • 1462, [Linux]: (tests) make tests invariant to LANG setting (patch by Benjamin Drung)
  • 1463: cpu_distribution.py script was broken.
  • 1470, [Linux]: disk_partitions(): fix corner case when /etc/mtab doesn't exist. (patch by Cedric Lamoriniere)
  • 1471, [SunOS]: Process.name() and Process.cmdline() can return SystemError. (patch by Daniel Beer)
  • 1472, [Linux]: cpu_freq() does not return all CPUs on Rasbperry-pi 3.
  • 1474: fix formatting of psutil.tests() which mimicks ps aux output.
  • 1475, [Windows], [critical]: OSError.winerror attribute wasn't properly checked resuling in WindowsError(ERROR_ACCESS_DENIED) being raised instead of AccessDenied.
  • 1477, [Windows]: wrong or absent error handling for private NTSTATUS Windows APIs. Different process methods were affected by this.
  • 1480, [Windows], [critical]: cpu_count() with logical=False could cause a crash due to fixed read violation. (patch by Samer Masterson)
  • 1486, [AIX], [SunOS]: AttributeError when interacting with Process methods involved into Process.oneshot() context.
  • 1491, [SunOS]: net_if_addrs(): use free() against ifap struct on error. (patch by Agnewee)
  • 1493, [Linux]: cpu_freq(): handle the case where /sys/devices/system/cpu/cpufreq/ exists but it's empty.

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 rtlIpv6AddressToStringA not available on Wine.
  • 1451, [Windows], [critical]: Process.memory_full_info() segfaults. NtQueryVirtualMemory is now used instead of QueryWorkingSet to calculate USS memory.

5.6.0

2019-03-05

Enhancements

  • 1379, [Windows]: Process.suspend() and Process.resume() now use NtSuspendProcess and NtResumeProcess instead of stopping/resuming all threads of a process. This is faster and more reliable (aka this is what ProcessHacker does).
  • 1420, [Windows]: in case of exception disk_usage() now also shows the path name.
  • 1422, [Windows]: Windows APIs requiring to be dynamically loaded from DLL libraries are now loaded only once on startup (instead of on per function call) significantly speeding up different functions and methods.
  • 1426, [Windows]: PAGESIZE and number of processors is now calculated on startup.
  • 1428: in case of error, the traceback message now shows the underlying C function called which failed.
  • 1433: new Process.parents() method. (idea by Ghislain Le Meur)
  • 1437: pids() are returned in sorted order.
  • 1442: Python 3 is now the default interpreter used by Makefile.

Bug fixes

Incompatible API changes

5.5.1

2019-02-15

Enhancements

  • 1348, [Windows]: on Windows >= 8.1 if Process.cmdline() fails due to ERROR_ACCESS_DENIED attempt using NtQueryInformationProcess + ProcessCommandLineInformation. (patch by EccoTheFlintstone)

Bug fixes

  • 1394, [Windows]: Process.exe() returns "[Error 0] The operation completed successfully" when Python process runs in "Virtual Secure Mode".
  • 1402: psutil exceptions' repr() show the internal private module path.
  • 1408, [AIX], [critical]: psutil won't compile on AIX 7.1 due to missing header. (patch by Arnon Yaari)

5.5.0

2019-01-23

Enhancements

Bug fixes

  • 1111: Process.oneshot() is now thread safe.
  • 1354, [Linux]: disk_io_counters() fails on Linux kernel 4.18+.
  • 1357, [Linux]: Process.memory_maps() and Process.io_counters() methods are no longer exposed if not supported by the kernel.
  • 1368, [Windows]: fix Process.ionice() mismatch. (patch by EccoTheFlintstone)
  • 1370, [Windows]: improper usage of CloseHandle() may lead to override the original error code when raising an exception.
  • 1373, [critical]: incorrect handling of cache in Process.oneshot() context causes Process instances to return incorrect results.
  • 1376, [Windows]: OpenProcess now uses PROCESS_QUERY_LIMITED_INFORMATION access rights wherever possible, resulting in less AccessDenied exceptions being thrown for system processes.
  • 1376, [Windows]: check if variable is NULL before free() ing it. (patch by EccoTheFlintstone)

5.4.8

2018-10-30

Enhancements

  • 1197, [Linux]: cpu_freq() is now implemented by parsing /proc/cpuinfo in case /sys/devices/system/cpu/* filesystem is not available.
  • 1310, [Linux]: sensors_temperatures() now parses /sys/class/thermal in case /sys/class/hwmon fs is not available (e.g. Raspberry Pi). (patch by Alex Manuskin)
  • 1320, [POSIX]: better compilation support when using g++ instead of GCC. (patch by Jaime Fullaondo)

Bug fixes

5.4.7

2018-08-14

Enhancements

  • 1286, [macOS]: psutil.OSX constant is now deprecated in favor of new psutil.MACOS.
  • 1309, [Linux]: added psutil.STATUS_PARKED constant for Process.status().
  • 1321, [Linux]: add disk_io_counters() dual implementation relying on /sys/block filesystem in case /proc/diskstats is not available. (patch by Lawrence Ye)

Bug fixes

5.4.6

2018-06-07

Bug fixes

5.4.5

2018-04-14

Bug fixes

  • 1268: setup.py's extra_require parameter requires latest setuptools version, breaking quite a lot of installations.

5.4.4

2018-04-13

Enhancements

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() with percpu=True return fewer CPUs on systems using process groups (> 64 cores).
  • 771, [Windows]: cpu_stats() and cpu_freq() may return incorrect results on systems using process groups (> 64 cores).
  • 1193, [SunOS]: return uid/gid from /proc/pid/psinfo if there aren't enough permissions for /proc/pid/cred. (patch by Georg Sauthoff)
  • 1194, [SunOS]: return nice value from psinfo as getpriority() doesn't support real-time processes. (patch by Georg Sauthoff)
  • 1194, [SunOS]: fix double free() in Process.cpu_num(). (patch by Georg Sauthoff)
  • 1194, [SunOS]: fix undefined behavior related to strict-aliasing rules and warnings. (patch by Georg Sauthoff)
  • 1210, [Linux]: cpu_percent() steal time may remain stuck at 100% due to Linux erroneously reporting a decreased steal time between calls. (patch by Arnon Yaari)
  • 1216: fix compatibility with Python 2.6 on Windows (patch by Dan Vinakovsky)
  • 1222, [Linux]: Process.memory_full_info() was erroneously summing "Swap:" and "SwapPss:". Same for "Pss:" and "SwapPss". Not anymore.
  • 1224, [Windows]: Process.wait() may erroneously raise TimeoutExpired.
  • 1238, [Linux]: sensors_battery() may return None in case battery is not listed as "BAT0" under /sys/class/power_supply.
  • 1240, [Windows]: cpu_times() float loses accuracy in a long running system. (patch by stswandering)
  • 1245, [Linux]: sensors_temperatures() may fail with IOError "no such file".
  • 1255, [FreeBSD]: swap_memory() stats were erroneously represented in KB. (patch by Denis Krienbühl)

Backward compatibility

  • 771, [Windows]: cpu_count() with logical=False on Windows XP and Vista is no longer supported and returns None.

5.4.3

2018-01-01

Enhancements

Bug fixes

5.4.2

2017-12-07

Enhancements

  • 1173: introduced PSUTIL_DEBUG environment variable which can be set in order to print useful debug messages on stderr (useful in case of nasty errors).
  • 1177, [macOS]: added support for sensors_battery(). (patch by Arnon Yaari)
  • 1183: Process.children() is 2x faster on POSIX and 2.4x faster on Linux.
  • 1188: deprecated method Process.memory_info_ex() now warns by using FutureWarning instead of DeprecationWarning.

Bug fixes

  • 1152, [Windows]: disk_io_counters() may return an empty dict.
  • 1169, [Linux]: users() hostname returns username instead. (patch by janderbrain)
  • 1172, [Windows]: make test does not work.
  • 1179, [Linux]: Process.cmdline() is now able to split cmdline args for misbehaving processes which overwrite /proc/pid/cmdline and use spaces instead of null bytes as args separator.
  • 1181, [macOS]: Process.memory_maps() may raise ENOENT.
  • 1187, [macOS]: pids() does not return PID 0 on recent macOS versions.

5.4.1

2017-11-08

Enhancements

Bug fixes

  • 1150, [Windows]: when a process is terminated now the exit code is set to SIGTERM instead of 0. (patch by Akos Kiss)
  • 1151: python -m psutil.tests fail.
  • 1154, [AIX], [critical]: psutil won't compile on AIX 6.1.0. (patch by Arnon Yaari)
  • 1167, [Windows]: net_io_counters() packets count now include also non-unicast packets. (patch by Matthew Long)

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 with IOError.
  • 1012, [Windows]: disk_io_counters() read_time and write_time were expressed in tens of micro seconds instead of milliseconds.
  • 1127, [macOS], [critical]: invalid reference counting in Process.open_files() may lead to segfault. (patch by Jakub Bacic)
  • 1129, [Linux]: sensors_fans() may crash with IOError. (patch by Sebastian Saip)
  • 1131, [SunOS]: fix compilation warnings. (patch by Arnon Yaari)
  • 1133, [Windows]: can't compile on newer versions of Visual Studio 2017 15.4. (patch by Max Bélanger)
  • 1138, [Linux]: can't compile on CentOS 5.0 and RedHat 5.0. (patch by Prodesire)

5.3.1

2017-09-10

Enhancements

Bug fixes

Compatibility notes

  • 1120: .exe files for Windows are no longer uploaded on PyPI as per PEP-527. Only wheels are provided.

5.3.0

2017-09-01

Enhancements

Bug fixes

Porting notes

  • 1039: returned types consolidation. 1) Windows / Process.cpu_times(): fields #3 and #4 were int instead of float. 2) Linux / FreeBSD / OpenBSD: Process.connections() raddr is now set to "" instead of None when retrieving UNIX sockets.
  • 1040: all strings are encoded by using OS fs encoding.
  • 1040: the following Windows APIs on Python 2 now return a string instead of unicode: Process.memory_maps().path, WindowsService.bin_path(), WindowsService.description(), WindowsService.display_name(), WindowsService.username().

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 raise ValueError.
  • 1006, [Linux]: cpu_freq() may return None on some Linux versions does not support the function. Let's not make the function available instead.
  • 1009, [Linux]: sensors_temperatures() may raise OSError.
  • 1010, [Linux]: virtual_memory() may raise ValueError on Ubuntu 14.04.

5.2.1

2017-03-24

Bug fixes

5.2.0

2017-03-05

Enhancements

Bug fixes

5.1.3

Bug fixes

5.1.2

2017-02-03

Bug fixes

5.1.1

2017-02-03

Enhancements

Bug fixes

5.1.0

2017-02-01

Enhancements

Bug fixes

  • 687, [Linux]: pid_exists() no longer returns True if passed a process thread ID.
  • 948: cannot install psutil with PYTHONOPTIMIZE=2.
  • 950, [Windows]: Process.cpu_percent() was calculated incorrectly and showed higher number than real usage.
  • 951, [Windows]: the uploaded wheels for Python 3.6 64 bit didn't work.
  • 959: psutil exception objects could not be pickled.
  • 960: psutil.Popen wait() did not return the correct negative exit status if process is killed by a signal.
  • 961, [Windows]: WindowsService.description() method may fail with ERROR_MUI_FILE_NOT_FOUND.

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() and cpu_times_percent() was calculated incorrectly as iowait, guest and guest_nice times were not properly taken into account.
  • 944, [OpenBSD]: pids() was omitting PID 0.

5.0.0

2016-11-06

Enhncements

  • 799: new Process.oneshot() context manager making Process methods around +2x faster in general and from +2x to +6x faster on Windows.
  • 943: better error message in case of version conflict on import.

Bug fixes

4.4.2

2016-10-26

Bug fixes

  • 931, [critical]: psutil no longer compiles on Solaris.

4.4.1

2016-10-25

Bug fixes

  • 927, [critical]: psutil.Popen __del__ may cause maximum recursion depth error.

4.4.0

2016-10-23

Enhancements

  • 874, [Windows]: make net_if_addrs() also return the netmask.
  • 887, [Linux]: virtual_memory() available and used values are more precise and match free cmdline utility. available also takes into account LCX containers preventing available to overflow total.
  • 891: procinfo.py script has been updated and provides a lot more info.

Bug fixes

4.3.1

2016-09-01

Enhancements

  • 881: make install now works also when using a virtual env.

Bug fixes

4.3.0

2016-06-18

Enhancements

Bug fixes

  • 810, [Windows]: Windows wheels are incompatible with pip 7.1.2.
  • 812, [NetBSD], [critical]: fix compilation on NetBSD-5.x.
  • 823, [NetBSD]: virtual_memory() raises TypeError on Python 3.
  • 829, [POSIX]: disk_usage() percent field takes root reserved space into account.
  • 816, [Windows]: fixed net_io_counters() values wrapping after 4.3GB in Windows Vista (NT 6.0) and above using 64bit values from newer win APIs.

4.2.0

2016-05-14

Enhancements

Bug fixes

4.1.0

2016-03-12

Enhancements

Bug fixes

4.0.0

2016-02-17

Enhancements

  • 523, [Linux], [FreeBSD]: disk_io_counters() return a new busy_time field.
  • 660, [Windows]: make.bat is smarter in finding alternative VS install locations. (patch by mpderbec)
  • 732: Process.environ(). (patch by Frank Benkstein)
  • 753, [Linux], [macOS], [Windows]: process USS and PSS (Linux) "real" memory stats. (patch by Eric Rahm)
  • 755: Process.memory_percent() memtype parameter.
  • 758: tests now live in psutil namespace.
  • 760: expose OS constants (psutil.LINUX, psutil.OSX, etc.)
  • 756, [Linux]: disk_io_counters() return 2 new fields: read_merged_count and write_merged_count.
  • 762: new procsmem.py script.

Bug fixes

3.4.2

2016-01-20

Enhancements

  • 728, [SunOS]: exposed PROCFS_PATH constant to change the default location of /proc filesystem.

Bug fixes

3.4.1

2016-01-15

Enhancements

Bug fixes

3.3.0

2015-11-25

Enhancements

  • 558, [Linux]: exposed PROCFS_PATH constant to change the default location of /proc filesystem.
  • 615, [OpenBSD]: added OpenBSD support. (contributed by Landry Breuil)

Bug fixes

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 ValueError if 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

Bug fixes

  • 513, [Linux]: fixed integer overflow for RLIM_INFINITY.
  • 641, [Windows]: fixed many compilation warnings. (patch by Jeff Tang)
  • 652, [Windows]: net_if_addrs() UnicodeDecodeError in case of non-ASCII NIC names.
  • 655, [Windows]: net_if_stats() UnicodeDecodeError in case of non-ASCII NIC names.
  • 659, [Linux]: compilation error on Suse 10. (patch by maozguttman)
  • 664, [Linux]: compilation error on Alpine Linux. (patch by Bart van Kleef)
  • 670, [Windows]: segfgault of net_if_addrs() in case of non-ASCII NIC names. (patch by sk6249)
  • 672, [Windows]: compilation fails if using Windows SDK v8.0. (patch by Steven Winfield)
  • 675, [Linux]: net_connections(): UnicodeDecodeError may occur when listing UNIX sockets.

3.1.1

2015-07-15

Bug fixes

3.1.0

2015-07-15

Enhancements

Bug fixes

  • 340, [Windows], [critical]: Process.open_files() no longer hangs. Instead it uses a thred which times out and skips the file handle in case it's taking too long to be retrieved. (patch by Jeff Tang)
  • 627, [Windows]: Process.name() no longer raises AccessDenied for pids owned by another user.
  • 636, [Windows]: Process.memory_info() raise AccessDenied.
  • 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]: *connections functions may swallow errors and return an incomplete list of connnections.
  • 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 enum package 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-la ifconfig.
  • 469: on Python >= 3.4 IOPRIO_CLASS_* and *_PRIORITY_CLASS constants returned by Process.ionice() and Process.nice() are enums instead of plain integers.
  • 581: add .gitignore. (patch by Gabi Davar)
  • 582: connection constants returned by net_connections() and Process.connections() were turned from int to enums on Python > 3.4.
  • 587: move native extension into the package.
  • 589: Process.cpu_affinity() accepts any kind of iterable (set, tuple, ...), not only lists.
  • 594: all deprecated APIs were removed.
  • 599, [Windows]: Process.name() can now be determined for all processes even when running as a limited user.
  • 602: pre-commit GIT hook.
  • 629: enhanced support for pytest and nose test runners.
  • 616, [Windows]: add inet_ntop() function for Windows XP.

Bug fixes

2.2.1

2015-02-02

Bug fixes

  • 572, [Linux]: fix "ValueError: ambiguos 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: new pstree.py script.
  • 564: C extension version mismatch in case the user messed up with psutil installation or with sys.path is now detected at import time.
  • 568: new pidof.py script.
  • 569, [FreeBSD]: add support for `Process.cpu_affinity`_ on FreeBSD.

Bug fixes

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 tox to run tests on multiple Python versions. (patch by msabramo)
  • 505, [Windows]: distribution as wheel packages.
  • 511: add ps.py script.

Bug fixes

2.1.1

2014-04-30

Bug fixes

2.1.0

2014-04-08

Enhancements

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: number of logical CPUs and physical cores (cpu_count()).
  • 447: wait_procs() timeout parameter is now optional.
  • 452: make Process instances hashable and usable with set() s.
  • 453: tests on Python < 2.7 require unittest2 module.
  • 459: add a Makefile for running tests and other repetitive tasks (also on Windows).
  • 463: make timeout parameter of cpu_percent* functions default to 0.0 'cause it's a common trap to introduce slowdowns.
  • 468: move documentation to readthedocs.com.
  • 477: Process.cpu_percent() is about 30% faster. (suggested by crusaderky)
  • 478, [Linux]: almost all APIs are about 30% faster on Python 3.X.
  • 479: long deprecated psutil.error module is gone; exception classes now live in psutil namespace only.

Bug fixes

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 Process get_* methods lost the get_ prefix. E.g. get_ext_memory_info() was renamed to memory_info_ex(). Assuming p = 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 Process set_* methods lost the set_ prefix. Assuming p = 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, all Process class properties have been turned into methods. This is the only case which there are no aliases. Assuming p = 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.error module is gone; exception classes now live in "psutil" namespace only.

  • Process instances' retcode attribute returned by wait_procs() has been renamed to returncode for consistency with subprocess.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 to Process class 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

Bug fixes

API changes

  • 408: turn STATUS_* and CONN_* constants into plain Python strings.

1.0.1

2013-07-12

Bug fixes

1.0.0

2013-07-10

Enhancements

  • 18, [SunOS]: add Solaris support (yay!) (thanks Justin Venus)
  • 367: Process.connections() status strings 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 raise ValueError.
  • 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

0.7.1

2013-05-03

Bug fixes

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 of psutil.BOOT_TIME since the latter cannot reflect system clock updates.
  • 361, [Linux]: cpu_times() now includes new steal, guest and guest_nice fields 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() and swap_memory() can crash on certain exotic Linux flavors having an incomplete /proc interface. If that's the case we now set the unretrievable stats to 0 and raise RuntimeWarning instead.
  • 315, [macOS]: fix some compilation warnings.
  • 317, [Windows]: cannot set process CPU affinity above 31 cores.
  • 319, [Linux]: Process.memory_maps() raises KeyError '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_time and write_time parameters were reporting microseconds not milliseconds. (patch by Gregory Szorc)
  • 331: Process.cmdline() is no longer cached after first acces as it may change.
  • 333, [macOS]: leak of Mach ports (patch by rsesek@google.com)
  • 337, [Linux], [critical]: Process methods not working because of a poor /proc implementation will raise NotImplementedError rather than RuntimeError and Process.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 to kvm_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)
  • 353, [macOS]: users() returns an empty list on macOS 10.8.
  • 356: Process.parent() now checks whether parent PID has been reused in which case returns None.
  • 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() and Process.cwd() methods raise RuntimeError instead of AccessDenied.

API changes

  • Process.cmdline() property is no longer cached after first access.
  • Process.ppid() property is no longer cached after first access.
  • [Linux] Process methods not working because of a poor /proc implementation will raise NotImplementedError instead of RuntimeError.
  • psutil.error module 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

0.6.0

2012-08-13

Enhancements

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() and Process.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. AccessDenied is now raised instead.

API changes

  • psutil.phymem_usage() is deprecated (use virtual_memory())
  • psutil.virtmem_usage() is deprecated (use swap_memory())
  • [Linux]: psutil.phymem_buffers() is deprecated (use virtual_memory())
  • [Linux]: psutil.cached_phymem() is deprecated (use virtual_memory())
  • [Windows], [BSD]: psutil.virtmem_usage() now returns information about swap memory instead of virtual memory.

0.5.1

2012-06-29

Enhancements

Bug fixes

0.5.0

2012-06-27

Enhancements

Bug fixes

API changes

0.4.1

2011-12-14

Bug fixes

0.4.0

2011-10-29

Enhancements

Bug fixes

  • 135, [macOS]: psutil cannot create Process object.
  • 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 multicore processors.
  • 197, [Linux]: Process.connections() is broken on platforms not supporting IPv6.
  • 200, [Linux], [critical]: psutil.NUM_CPUS not working on armel and sparc architectures and causing crash on module import.
  • 201, [Linux]: Process.connections() is broken on big-endian architectures.
  • 211: Process instance can unexpectedly raise NoSuchProcess if 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

Bug fixes

0.2.1

2011-03-20

Enhancements

Bug fixes

API changes

  • Process uid and gid properties are deprecated in favor of uids and gids properties.

0.2.0

2010-11-13

Enhancements

Bug fixes

API changes

0.1.3

2010-03-02

Enhancements

Bug fixes

  • 36: Process.cpu_times() and Process.memory_info() functions succeeded. also for dead processes while a NoSuchProcess exception 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 in getcmdpath().
  • 50, [BSD]: fixed getcmdargs() memory fragmentation.
  • 55, [Windows]: test_pid_4 was 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 before Process.kill() to make sure we are going to kill the correct process.
  • 73, [macOS]: virtual memory size reported on includes shared library size.
  • 77: NoSuchProcess wasn't raised on Process.create_time() if Process.kill() was used first.

0.1.2

2009-05-06

Enhancements

Bug fixes

0.1.1

2009-03-06

Enhancements

  • 4, [FreeBSD]: support for all functions of psutil.
  • 9, [macOS], [Windows]: add Process.uid and Process.gid, returning process UID and GID.
  • 11: per-process parent object: Process.parent() property returns a Process object representing the parent process, and Process.ppid() returns the parent PID.
  • 12, 15: NoSuchProcess exception now raised when creating an object for a nonexistent process, or when retrieving information about a process that has gone away.
  • 21, [Windows]: AccessDenied exception created for raising access denied errors from OSError or WindowsError on individual platforms.
  • 26: process_iter() function to iterate over processes as Process objects with a generator.
  • Process objects 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() ignores NoSuchProcess and AccessDenied exceptions 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 raises AccessDenied exception instead of WindowsError.
  • 30: psutil.get_pid_list() was returning two 0 PIDs.