Update of /cvsroot/mailman/mailman3/src/mailman/config
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10284

Modified Files:
        datatypes.py 
Log Message:
username, groupname: Provide more informative error messages.


Index: datatypes.py
===================================================================
RCS file: /cvsroot/mailman/mailman3/src/mailman/config/datatypes.py,v
retrieving revision 3.3
retrieving revision 3.4
diff -u -d -r3.3 -r3.4
--- datatypes.py        22 Apr 2004 23:08:25 -0000      3.3
+++ datatypes.py        23 Apr 2004 23:54:00 -0000      3.4
@@ -120,7 +120,11 @@
                 uname = '<uid %s>' % uid
         except ValueError:
             uname = s
-            uid = pwd.getpwnam(s)[2]
+            try:
+                uid = pwd.getpwnam(s)[2]
+            except KeyError:
+                # Give a better error message than Python 2.3
+                raise KeyError('getpwnam(): name not found: %s' % s)
         self.id = uid
         self.name = uname
 
@@ -135,7 +139,10 @@
                 gname = '<gid %s>' % gid
         except ValueError:
             gname = s
-            gid = grp.getgrnam(s)[2]
+            try:
+                gid = grp.getgrnam(s)[2]
+            except KeyError:
+                raise KeyError('getgrnam(): name not found: %s' % s)
         self.id = gid
         self.name = gname
 


_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to