summaryrefslogtreecommitdiff
path: root/psutil/_pslinux.py
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-02-03 18:52:03 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2017-02-03 18:52:03 +0100
commit44ca122c1c7fc131ad7f6587203a5d8d97a4bb30 (patch)
tree17823f753a2e324caaa59c2f7c9fa9371b8d6832 /psutil/_pslinux.py
parent941512903e8cf3e00c403427494500565094ef97 (diff)
downloadpsutil-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.py5
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)