Browse Source

wxgui core: fix uid bug when uid is missing, for example with network shared data (trunk, https://trac.osgeo.org/grass/changeset/61764)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@61765 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 10 năm trước cách đây
mục cha
commit
6bd47fa9e0
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      gui/wxpython/gui_core/preferences.py

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

@@ -1775,7 +1775,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: