diff options
| author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-02-03 18:52:03 +0100 |
|---|---|---|
| committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-02-03 18:52:03 +0100 |
| commit | 44ca122c1c7fc131ad7f6587203a5d8d97a4bb30 (patch) | |
| tree | 17823f753a2e324caaa59c2f7c9fa9371b8d6832 /psutil/_pslinux.py | |
| parent | 941512903e8cf3e00c403427494500565094ef97 (diff) | |
| download | psutil-44ca122c1c7fc131ad7f6587203a5d8d97a4bb30.tar.gz | |
fix #970 [Linux] sensors_battery()'s name and label fields on Python 3 are bytes
Diffstat (limited to 'psutil/_pslinux.py')
| -rw-r--r-- | psutil/_pslinux.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index 902071c9..fdb48f96 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -1082,8 +1082,9 @@ def sensors_temperatures(): [x.split('_')[0] for x in glob.glob('/sys/class/hwmon/hwmon*/temp*_*')])) for base in basenames: - unit_name = cat(os.path.join(os.path.dirname(base), 'name')) - label = cat(base + '_label', fallback='') + unit_name = cat(os.path.join(os.path.dirname(base), 'name'), + binary=False) + label = cat(base + '_label', fallback='', binary=False) current = float(cat(base + '_input')) / 1000.0 high = cat(base + '_max', fallback=None) critical = cat(base + '_crit', fallback=None) |
