diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-07 18:49:45 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-07 18:49:45 +0100 |
commit | fe481ed53fae8b9ce814edf224ffbf14aa2cbbcc (patch) | |
tree | c1714c4f5f1e1c41cab58965f3f93b6b8cd8a8d6 | |
parent | 6a4fbe1bd9da21684eecd77a92f168af8d12d950 (diff) | |
download | psutil-fe481ed53fae8b9ce814edf224ffbf14aa2cbbcc.tar.gz |
fix #1674, SunOS: disk_partitions() may raise OSError.
-rw-r--r-- | HISTORY.rst | 3 | ||||
-rw-r--r-- | psutil/_pssunos.py | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/HISTORY.rst b/HISTORY.rst index ca651f04..0277db58 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -33,6 +33,7 @@ XXXX-XX-XX - 1672_: properly handle PID C type. - 1673_: [OpenBSD] Process connections(), num_fds() and threads() returned improper exception if process is gone. +- 1674_: [SunOS] disk_partitions() may raise OSError. 5.6.7 ===== @@ -54,7 +55,7 @@ XXXX-XX-XX renaming the command line and using inappropriate chars to separate args. - 1616_: use of Py_DECREF instead of Py_CLEAR will result in double free and segfault - (`CVE-2019-18874 <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-18874>`__). + (`CVE-2019-18874 <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-18874>`__). (patch by Riccardo Schirone) - 1619_: [OpenBSD] compilation fails due to C syntax error. (patch by Nathan Houghton) diff --git a/psutil/_pssunos.py b/psutil/_pssunos.py index b1e2d1c9..b82771ee 100644 --- a/psutil/_pssunos.py +++ b/psutil/_pssunos.py @@ -225,7 +225,11 @@ def disk_partitions(all=False): # Differently from, say, Linux, we don't have a list of # common fs types so the best we can do, AFAIK, is to # filter by filesystem having a total size > 0. - if not disk_usage(mountpoint).total: + try: + if not disk_usage(mountpoint).total: + continue + except OSError: + # https://github.com/giampaolo/psutil/issues/1674 continue ntuple = _common.sdiskpart(device, mountpoint, fstype, opts) retlist.append(ntuple) |