浏览代码

wxgui core: fix uid bug when uid is missing, for example with network shared data

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61764 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 10 年之前
父节点
当前提交
7922bbd219
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      gui/wxpython/gui_core/preferences.py

+ 4 - 1
gui/wxpython/gui_core/preferences.py

@@ -1776,7 +1776,10 @@ class CheckListMapset(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.Check
                                       mapset)
             stat_info = os.stat(mapsetPath)
             if havePwd:
-                self.SetStringItem(index, 1, "%s" % pwd.getpwuid(stat_info.st_uid)[0])
+                try:
+                    self.SetStringItem(index, 1, "%s" % pwd.getpwuid(stat_info.st_uid)[0])
+                except KeyError:
+                    self.SetStringItem(index, 1, "nobody")
                 # FIXME: get group name
                 ### self.SetStringItem(index, 2, "%-8s" % stat_info.st_gid) 
             else: