From 16c84e23a987cbe9de5faeb63d7daef8076699f7 Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 15 Feb 2021 15:57:24 +1030 Subject: [PATCH] Catch OSError exception in psutil. Fixes https://github.com/GNS3/gns3-gui/issues/3127 --- gns3server/handlers/api/controller/server_handler.py | 2 +- gns3server/run.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/handlers/api/controller/server_handler.py b/gns3server/handlers/api/controller/server_handler.py index a033ac88..915faa39 100644 --- a/gns3server/handlers/api/controller/server_handler.py +++ b/gns3server/handlers/api/controller/server_handler.py @@ -231,7 +231,7 @@ Processus: try: psinfo = proc.as_dict(attrs=["name", "exe"]) data += "* {} {}\n".format(psinfo["name"], psinfo["exe"]) - except psutil.NoSuchProcess: + except (OSError, psutil.NoSuchProcess, psutil.AccessDenied): pass data += "\n\nProjects" diff --git a/gns3server/run.py b/gns3server/run.py index 5330e0a5..2d0cf98b 100644 --- a/gns3server/run.py +++ b/gns3server/run.py @@ -195,7 +195,7 @@ def kill_ghosts(): if name in detect_process: proc.kill() log.warning("Killed ghost process %s", name) - except (psutil.NoSuchProcess, psutil.AccessDenied): + except (OSError, psutil.NoSuchProcess, psutil.AccessDenied): pass