One of the less fun aspects of process management on POSIX systems is waiting for a process to terminate. The standard library's subprocess module has relied on a busy-loop polling approach since the timeout parameter was added to...
Memory leaks in Python are usually straightforward to diagnose. Just look at RSS, track Python object counts, follow reference graphs, etc. But leaks inside C extension modules are another story. Traditional memory metrics such as RSS and VMS...
With the release of psutil 7.1.2, wheels for free-threaded Python are now available. This milestone was achieved largely through a community effort, as several internal refactorings to the C code were required to make it possible (see #2565)....
Preface: the migration to pytest Last year, after 17 years of unittest, I started adopting pytest in psutil (see #2446). The two advantages I cared about most were plain assert statements and pytest-xdist's free parallelism. Tests still inherit...
While browsing, I almost always keep three tabs open: Gmail, Slack, and Microsoft Teams (for work). I find it convenient to have them always in the same position (1, 2, and 3), so I can quickly switch to them using keyboard shortcuts (alt+1,...
About dropping Python 2.7 support in psutil, 3 years ago I stated (#2014): Not a chance, for many years to come. [Python 2.7] currently represents 7-10% of total downloads, meaning around 70k / 100k downloads per day. Only 3 years later, and to...
Lately I've been dealing with an asynchronous TCP client app which sends messages to a remote server. Some of these messages are important, and cannot get lost. Because the connection may drop at any time, I had to implement a mechanism to resend...
My editor of choice for Python development is Sublime Text. It has been for a very long time (10 years). It's fast, minimalist and straight to the point, which is why I always resisted the temptation to use more advanced and modern IDEs such as...
Hello there. Here is my new blog / personal website! This is something I've been wanting to do for a very long time, since the old blog hosted at https://grodola.blogspot.com/ was... well, too old. =) This new site is based on Pelican, a static...
psutil 5.6.2 is out. It implements an emulation of os.getloadavg() on Windows, kindly contributed by Ammar Askar, who originally implemented it for CPython's test suite. This idea has been floating around for quite a while. The first proposal...
psutil 5.6.0 is out. Highlights: a new Process.parents() method, several important Windows improvements, and the removal of Process.memory_maps() on macOS. Process parents() The new method returns the parents of a process as a list of Process...
This is part of the psutil 5.6.0 release (see the full release notes). As of 5.6.0, Process.memory_maps() is no longer defined on macOS. The bug #1291: on macOS, Process.memory_maps() would either raise OSError: [Errno 22] Invalid argument or...
After a long wait psutil finally supports a new exotic platform: AIX! Honestly I'm not sure how many AIX Python users are out there (probably not many), but here it is. For this we have to thank Arnon Yaari, who started working on the port a...
psutil 5.3.0 is finally out. This release is a major one, bigger than any release before it in terms of improvements and bugfixes. It is interesting to notice how huge the diff between 5.2.2 and 5.3.0 is. This is because I've been travelling quite …
This one took a while. Adding proper Unicode support to psutil took four months of auditing, design decisions, and rewriting nearly every API that returned a string. The full journey is documented in #1040, and what follows is a summary. This can...