diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-11 18:16:02 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-11 18:16:02 +0100 |
commit | d8cb832f8cc7ef2695472ec0f752c59c72916274 (patch) | |
tree | 3baed4d085b2333229e875a856cafa5a72d3610e | |
parent | 1ec2f2ec0c7e751f3c68eca477c197690b4c2667 (diff) | |
download | psutil-d8cb832f8cc7ef2695472ec0f752c59c72916274.tar.gz |
fix #1627: [Linux] Process.memory_maps() can raise KeyError
-rw-r--r-- | HISTORY.rst | 1 | ||||
-rw-r--r-- | psutil/_pslinux.py | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/HISTORY.rst b/HISTORY.rst index e5d42afa..68309241 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -23,6 +23,7 @@ XXXX-XX-XX **Bug fixes** - 1538_: [NetBSD] process cwd() may return ENOENT instead of NoSuchProcess. +- 1627_: [Linux] Process.memory_maps() can raise KeyError. - 1642_: [SunOS] querying basic info for PID 0 results in FileNotFoundError. - 1646_: [FreeBSD] many Process methods may cause a segfault on FreeBSD 12.0 due to a backward incompatible change in a C type introduced in 12.0. diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index ea1a8a08..eb03e8a3 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -1868,7 +1868,7 @@ class Process(object): path = path[:-10] ls.append(( decode(addr), decode(perms), path, - data[b'Rss:'], + data.get(b'Rss:', 0), data.get(b'Size:', 0), data.get(b'Pss:', 0), data.get(b'Shared_Clean:', 0), |