ANN: psutil 5.3.0 with full unicode support is out

Giampaolo Rodola' g.rodola at gmail.com
Sun Sep 3 10:58:35 EDT 2017


Hello all,
I'm glad to announce the release of psutil 5.3.0:
https://github.com/giampaolo/psutil
A blogpost describing the main changes is available here:
http://grodola.blogspot.com/2017/09/psutil-530-with-full-unicode-support-is.html

About
=====

psutil (process and system utilities) is a cross-platform library for
retrieving information on running processes and system utilization (CPU,
memory, disks, network) in Python. It is useful mainly for system
monitoring, profiling and limiting process resources and management of
running processes. It implements many functionalities offered by command
line tools such as: ps, top, lsof, netstat, ifconfig, who, df, kill, free,
nice, ionice, iostat, iotop, uptime, pidof, tty, taskset, pmap. It
currently supports Linux, Windows, OSX, Sun Solaris, FreeBSD, OpenBSD and
NetBSD, both 32-bit and 64-bit architectures, with Python versions from 2.6
to 3.5 (users of Python 2.4 and 2.5 may use 2.1.3 version). PyPy is also
known to work.

What's new
==========

**Enhancements**

- #802: disk_io_counters() and net_io_counters() numbers no longer wrap
  (restart from 0). Introduced a new "nowrap" argument.
- #928: psutil.net_connections() and psutil.Process.connections() "laddr"
and
  "raddr" are now named tuples.
- #1015: swap_memory() now relies on /proc/meminfo instead of sysinfo()
syscall
  so that it can be used in conjunction with PROCFS_PATH in order to
retrieve
  memory info about Linux containers such as Docker and Heroku.
- #1022: psutil.users() provides a new "pid" field.
- #1025: process_iter() accepts two new parameters in order to invoke
  Process.as_dict(): "attrs" and "ad_value". With this you can iterate over
all
  processes in one shot without needing to catch NoSuchProcess and do
list/dict
  comprehensions.
- #1040: implemented full unicode support.
- #1051: disk_usage() on Python 3 is now able to accept bytes.
- #1058: test suite now enables all warnings by default.
- #1060: source distribution is dynamically generated so that it only
includes
  relevant files.
- #1079: [FreeBSD] net_connections()'s fd number is now being set for real
  (instead of -1).  (patch by Gleb Smirnoff)
- #1091: [SunOS] implemented Process.environ().  (patch by Oleksii Shevchuk)

**Bug fixes**

- #989: [Windows] boot_time() may return a negative value.
- #1007: [Windows] boot_time() can have a 1 sec fluctuation between calls;
the
  value of the first call is now cached so that boot_time() always returns
the
  same value if fluctuation is <= 1 second.
- #1013: [FreeBSD] psutil.net_connections() may return incorrect PID.
 (patch
  by Gleb Smirnoff)
- #1014: [Linux] Process class can mask legitimate ENOENT exceptions as
  NoSuchProcess.
- #1016: disk_io_counters() raises RuntimeError on a system with no disks.
- #1017: net_io_counters() raises RuntimeError on a system with no network
  cards installed.
- #1021: [Linux] open_files() may erroneously raise NoSuchProcess instead of
  skipping a file which gets deleted while open files are retrieved.
- #1029: [OSX, FreeBSD] Process.connections('unix') on Python 3 doesn't
  properly handle unicode paths and may raise UnicodeDecodeError.
- #1033: [OSX, FreeBSD] memory leak for net_connections() and
  Process.connections() when retrieving UNIX sockets (kind='unix').
- #1040: fixed many unicode related issues such as UnicodeDecodeError on
  Python 3 + UNIX and invalid encoded data on Windows.
- #1042: [FreeBSD] psutil won't compile on FreeBSD 12.
- #1044: [OSX] different Process methods incorrectly raise AccessDenied for
  zombie processes.
- #1046: [Windows] disk_partitions() on Windows overrides user's
SetErrorMode.
- #1047: [Windows] Process username(): memory leak in case exception is
thrown.
- #1048: [Windows] users()'s host field report an invalid IP address.
- #1050: [Windows] Process.memory_maps memory() leaks memory.
- #1055: cpu_count() is no longer cached; this is useful on systems such as
  Linux where CPUs can be disabled at runtime. This also reflects on
  Process.cpu_percent() which no longer uses the cache.
- #1058: fixed Python warnings.
- #1062: disk_io_counters() and net_io_counters() raise TypeError if no
disks
  or NICs are installed on the system.
- #1063: [NetBSD] net_connections() may list incorrect sockets.
- #1064: [NetBSD] swap_memory() may segfault in case of error.
- #1065: [OpenBSD] Process.cmdline() may raise SystemError.
- #1067: [NetBSD] Process.cmdline() leaks memory if process has terminated.
- #1069: [FreeBSD] Process.cpu_num() may return 255 for certain kernel
  processes.
- #1071: [Linux] cpu_freq() may raise IOError on old RedHat distros.
- #1074: [FreeBSD] sensors_battery() raises OSError in case of no battery.
- #1075: [Windows] net_if_addrs(): inet_ntop() return value is not checked.
- #1077: [SunOS] net_if_addrs() shows garbage addresses on SunOS 5.10.
  (patch by Oleksii Shevchuk)
- #1077: [SunOS] net_connections() does not work on SunOS 5.10. (patch by
  Oleksii Shevchuk)
- #1079: [FreeBSD] net_connections() didn't list locally connected sockets.
  (patch by Gleb Smirnoff)
- #1085: cpu_count() return value is now checked and forced to None if <= 1.
- #1087: Process.cpu_percent() guard against cpu_count() returning None and
  assumes 1 instead.
- #1093: [SunOS] memory_maps() shows wrong 64 bit addresses.
- #1094: [Windows] psutil.pid_exists() may lie. Also, all process APIs
relying
  on OpenProcess Windows API now check whether the PID is actually running.
- #1098: [Windows] Process.wait() may erroneously return sooner, when the
PID
  is still alive.
- #1099: [Windows] Process.terminate() may raise AccessDenied even if the
  process already died.
- #1101: [Linux] sensors_temperatures() may raise ENODEV.

**Porting notes**

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

*2017-04-10*

Links
=====

- Home page: https://github.com/giampaolo/psutil
- Download: https://pypi.python.org/pypi/psutil
- Documentation: http://pythonhosted.org/psutil
- What's new: https://github.com/giampaolo/psutil/blob/master/HISTORY.rst

--

Giampaolo - http://grodola.blogspot.com


More information about the Python-announce-list mailing list