diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-02-03 18:31:55 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-02-03 18:31:55 +0100 |
commit | bde7f7bac923f83cc675c526cca791b9abc9baac (patch) | |
tree | b4bd5389bdf902e9eec8a6dc63c75e3a30c784b5 | |
parent | 9eb8f85fab0784b2fc23d4a1522f9b70427a0101 (diff) | |
download | psutil-bde7f7bac923f83cc675c526cca791b9abc9baac.tar.gz |
fix #968 / Linux: disk_io_counters() is broken on python 3
-rw-r--r-- | HISTORY.rst | 9 | ||||
-rw-r--r-- | psutil/_pslinux.py | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/HISTORY.rst b/HISTORY.rst index 97462302..81798899 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,5 +1,14 @@ *Bug tracker at https://github.com/giampaolo/psutil/issues* +5.1.2 +===== + +*2017-02-03* + +**Bug fixes** + +- 968_: [Linux] disk_io_counters() raises TypeError on python 3. + 5.1.1 ===== diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index 1183052b..902071c9 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -245,7 +245,7 @@ def file_flags_to_mode(flags): def get_sector_size(partition): try: - with open(b"/sys/block/%s/queue/hw_sector_size" % partition) as f: + with open("/sys/block/%s/queue/hw_sector_size" % partition, "rt") as f: return int(f.read()) except (IOError, ValueError): # man iostat states that sectors are equivalent with blocks and |