Fixes issue #197 - modified user stats to use pwd.getpwuid rather than pwd.getpwall

This commit is contained in:
martynhare 2018-09-08 13:52:10 +01:00
parent 980876e517
commit 12a9b599bf

View file

@ -176,6 +176,7 @@ class StatsDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
@QtCore.pyqtSlot()
def _on_update_triggered(self):
pw_name = "(UID error)"
if self.daemon_connected:
self._status_label.setText("running")
self._status_label.setStyleSheet('color: green')
@ -202,7 +203,7 @@ class StatsDialog(QtWidgets.QDialog, uic.loadUiType(DIALOG_UI_PATH)[0]):
if self._address is None:
for uid, hits in self._stats.by_uid.items():
try:
pw_name = pwd.getpwall(int(uid)).pw_name
pw_name = pwd.getpwuid(int(uid)).pw_name
except KeyError:
pw_name = "(UID error)"
finally: