Merge branch 'issue1120' into develop

This commit is contained in:
nicolargo 2017-07-08 11:04:59 +02:00
commit b3e20496e4
2 changed files with 4 additions and 2 deletions

1
NEWS
View File

@ -15,6 +15,7 @@ Bugs corrected:
* Potential memory leak in Windows WebUI (issue #1056)
* glances_network `OSError: [Errno 19] No such device` (issue #1106)
* GPU plugin. <class 'TypeError'>: ... not JSON serializable"> (issue #1112)
* PermissionError on macOS (issue #1120)
Installation:

View File

@ -240,8 +240,9 @@ class GlancesProcesses(object):
procstat.update(proc.as_dict(
attrs=['name', 'cpu_times', 'status', 'ppid'],
ad_value=''))
except psutil.NoSuchProcess:
except (psutil.NoSuchProcess, psutil.AccessDenied):
# Try/catch for issue #432 (process no longer exist)
# Try/catch for issue #1120 (only see on Macos)
return None
else:
procstat['status'] = str(procstat['status'])[:1].upper()
@ -250,7 +251,7 @@ class GlancesProcesses(object):
procstat.update(proc.as_dict(
attrs=['username', 'cpu_percent', 'memory_percent'],
ad_value=''))
except psutil.NoSuchProcess:
except (psutil.NoSuchProcess, psutil.AccessDenied):
# Try/catch for issue #432 (process no longer exist)
return None