summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-01-12 18:50:35 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2011-01-12 18:50:35 +0000
commitb633eab98e53dbbdb0c0d019e77d409b9b0adf58 (patch)
treefd0a72e23ef88ac6cf34a1a9478cb4313e1d05f7
parentde368717dad90577e4f491d3f4187742a7d00515 (diff)
downloadcpython-git-b633eab98e53dbbdb0c0d019e77d409b9b0adf58.tar.gz
Merged revisions 87958 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87958 | antoine.pitrou | 2011-01-12 19:45:27 +0100 (mer., 12 janv. 2011) | 4 lines Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch by Ross Lagerwall. ........
-rw-r--r--Lib/test/test_posix.py5
-rw-r--r--Misc/NEWS3
2 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 77f47fa1c2..51cc23ce05 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -274,6 +274,7 @@ class PosixTester(unittest.TestCase):
os.chdir(curdir)
support.rmtree(base_path)
+ @unittest.skipUnless(hasattr(os, 'getegid'), "test needs os.getegid()")
def test_getgroups(self):
with os.popen('id -G') as idg:
groups = idg.read().strip()
@@ -283,9 +284,11 @@ class PosixTester(unittest.TestCase):
# 'id -G' and 'os.getgroups()' should return the same
# groups, ignoring order and duplicates.
+ # #10822 - it is implementation defined whether posix.getgroups()
+ # includes the effective gid so we include it anyway, since id -G does
self.assertEqual(
set([int(x) for x in groups.split()]),
- set(posix.getgroups()))
+ set(posix.getgroups() + [posix.getegid()]))
class PosixGroupsTester(unittest.TestCase):
diff --git a/Misc/NEWS b/Misc/NEWS
index 63883911d1..efadff1e3c 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -141,6 +141,9 @@ Build
Tests
-----
+- Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
+ by Ross Lagerwall.
+
- Issue #6293: Have regrtest.py echo back sys.flags. This is done by default
in whole runs and enabled selectively using ``--header`` when running an
explicit list of tests. Original patch by Collin Winter.