Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not emit warning for broken temperatures on Linux #1316

Closed
giampaolo opened this issue Aug 1, 2018 · 1 comment
Closed

Do not emit warning for broken temperatures on Linux #1316

giampaolo opened this issue Aug 1, 2018 · 1 comment

Comments

@giampaolo
Copy link
Owner

A lot of things can go wrong when reading temperatures from /sys/class/hwmon/* filesystem:

psutil/psutil/_pslinux.py

Lines 1175 to 1184 in 45c0ebc

except (IOError, OSError) as err:
# A lot of things can go wrong here, so let's just skip the
# whole entry.
# https://github.com/giampaolo/psutil/issues/1009
# https://github.com/giampaolo/psutil/issues/1101
# https://github.com/giampaolo/psutil/issues/1129
# https://github.com/giampaolo/psutil/issues/1245
warnings.warn("ignoring %r for file %r" % (err, path),
RuntimeWarning)
continue

See re. #1009, #1101, #1129, #1245, #1203. This seems to be particularly painful for Glances as well: nicolargo/glances#1203. As such I think it makes sense to simply skip the broken entry without emitting any warning.

@giampaolo
Copy link
Owner Author

On a second though, it is already kinda of a shame we have to swallow the exception. Suppressing the warning would be even worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant