Skip to content

Commit

Permalink
#966: sensors_battery().power_plugged may erroneously return None on …
Browse files Browse the repository at this point in the history
…Python 3
  • Loading branch information
giampaolo committed Feb 3, 2017
1 parent 44ca122 commit ca01be5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

**Bug fixes**

- 966_: [Linux] sensors_battery().power_plugged may erroneously return None on
Python 3.
- 968_: [Linux] disk_io_counters() raises TypeError on python 3.
- 970_: [Linux] sensors_battery()'s name and label fields on Python 3 are bytes
instead of str.
Expand Down
2 changes: 1 addition & 1 deletion psutil/_pslinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ def multi_cat(*paths):
os.path.join(POWER_SUPPLY_PATH, "AC0/online"),
fallback=b"0") == b"1"
elif os.path.exists(root + "/status"):
status = cat(root + "/status", fallback="").lower()
status = cat(root + "/status", fallback="", binary=False).lower()
if status == "discharging":
power_plugged = False
elif status in ("charging", "full"):
Expand Down

0 comments on commit ca01be5

Please sign in to comment.