giampaolo / psutil

Cross-platform lib for process and system monitoring in Python
BSD 3-Clause "New" or "Revised" License
10.08k stars 1.37k forks source link

Add pickle support to psutil Exceptions #2380

Closed anthonyryan1 closed 3 months ago

anthonyryan1 commented 3 months ago

Summary

Description

Add __reduce__ method to exceptions commonly thrown, and start testing that exceptions can be pickled in test_serialization.

Prior to this, it was not possible to pickle a psutil exception (for error reporting), and this also made it impossible to send them through multiprocessing pipes. Code demonstrating the problem is available in #2272

giampaolo commented 3 months ago

Nice change. I like it.