giampaolo / psutil

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

Exit battery sensor retrival if path is non-existent #2438

Open lars-devs opened 2 months ago

lars-devs commented 2 months ago

Summary

Description

This PR extends the solution for issue #966. In my case, the path /sys/class/power_supply is missing completely other than having different variations of files below the BATx directory. To be fair, I only encountered this condition with an Ubuntu image provided by a hosting company, but I think, it's better to catch this issue in general.

grafik