summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-02-07 18:49:45 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2020-02-07 18:49:45 +0100
commitfe481ed53fae8b9ce814edf224ffbf14aa2cbbcc (patch)
treec1714c4f5f1e1c41cab58965f3f93b6b8cd8a8d6
parent6a4fbe1bd9da21684eecd77a92f168af8d12d950 (diff)
downloadpsutil-fe481ed53fae8b9ce814edf224ffbf14aa2cbbcc.tar.gz
fix #1674, SunOS: disk_partitions() may raise OSError.
-rw-r--r--HISTORY.rst3
-rw-r--r--psutil/_pssunos.py6
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)