[Python-checkins] r83136 - in python/branches/release26-maint: Lib/test/test_posix.py

ronald.oussoren python-checkins at python.org
Sat Jul 24 16:23:23 CEST 2010


Author: ronald.oussoren
Date: Sat Jul 24 16:23:23 2010
New Revision: 83136

Log:
Merged revisions 83135 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint

................
  r83135 | ronald.oussoren | 2010-07-24 15:21:29 +0100 (Sat, 24 Jul 2010) | 12 lines
  
  Merged revisions 83133 via svnmerge from 
  svn+ssh://pythondev@svn.python.org/python/branches/py3k
  
  ........
    r83133 | ronald.oussoren | 2010-07-24 15:15:19 +0100 (Sat, 24 Jul 2010) | 5 lines
    
    Fix for issue 9367: the test code for os.getgroups
    assumes that the result of getgroups and the output
    of the id(1) command return groups in the same 
    order.  That assumption is both fragile and false.
  ........
................


Modified:
   python/branches/release26-maint/   (props changed)
   python/branches/release26-maint/Lib/test/test_posix.py

Modified: python/branches/release26-maint/Lib/test/test_posix.py
==============================================================================
--- python/branches/release26-maint/Lib/test/test_posix.py	(original)
+++ python/branches/release26-maint/Lib/test/test_posix.py	Sat Jul 24 16:23:23 2010
@@ -314,7 +314,11 @@
         if not groups:
             raise unittest.SkipTest("need working 'id -G'")
 
-        self.assertEqual([int(x) for x in groups.split()], posix.getgroups())
+        # The order of groups isn't important, hence the calls
+        # to sorted.
+        self.assertEqual(
+                list(sorted([int(x) for x in groups.split()])),
+                list(sorted(posix.getgroups())))
 
 class PosixGroupsTester(unittest.TestCase):
     if posix.getuid() == 0 and hasattr(posix, 'getgroups') and sys.platform != 'darwin':


More information about the Python-checkins mailing list