diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2019-06-14 16:53:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-14 16:53:17 +0800 |
commit | 6bb5a30dbf8335db8d9b8c4e81d652f055deea6a (patch) | |
tree | 842fb7f6fe415207f8bff4b3876ae538ed740a69 /psutil/_psbsd.py | |
parent | 5f4287d17fc6aa2643c4c6e3589c12abd0f1ded9 (diff) | |
download | psutil-6bb5a30dbf8335db8d9b8c4e81d652f055deea6a.tar.gz |
[NetBSD] cmdline() raise ZombieProcess when unable to decode chars (#1536)
* bug #1536 / NetBSD / cmdline: treat EINVAL as 'return []'
This happens with unicode test, meaning the C routine it's
unable to decode the unicode chars.
Also, fix a bug introduced in 1530 (C impl of cwd()) which does not take
ENOENT into account.
Diffstat (limited to 'psutil/_psbsd.py')
-rw-r--r-- | psutil/_psbsd.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/psutil/_psbsd.py b/psutil/_psbsd.py index 9964f5ff..978ad6c8 100644 --- a/psutil/_psbsd.py +++ b/psutil/_psbsd.py @@ -648,10 +648,9 @@ class Process(object): return cext.proc_cmdline(self.pid) except OSError as err: if err.errno == errno.EINVAL: - if not pid_exists(self.pid): - raise NoSuchProcess(self.pid, self._name) - else: - raise ZombieProcess(self.pid, self._name, self._ppid) + # XXX: this happens with unicode tests. It means the C + # routine is unable to decode invalid unicode chars. + return [] else: raise else: |