Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b633eab

Browse files
committed
Merged revisions 87958 via svnmerge from
svn+ssh://[email protected]/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. ........
1 parent de36871 commit b633eab

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Lib/test/test_posix.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ def _create_and_do_getcwd(dirname, current_path_length = 0):
274274
os.chdir(curdir)
275275
support.rmtree(base_path)
276276

277+
@unittest.skipUnless(hasattr(os, 'getegid'), "test needs os.getegid()")
277278
def test_getgroups(self):
278279
with os.popen('id -G') as idg:
279280
groups = idg.read().strip()
@@ -283,9 +284,11 @@ def test_getgroups(self):
283284

284285
# 'id -G' and 'os.getgroups()' should return the same
285286
# groups, ignoring order and duplicates.
287+
# #10822 - it is implementation defined whether posix.getgroups()
288+
# includes the effective gid so we include it anyway, since id -G does
286289
self.assertEqual(
287290
set([int(x) for x in groups.split()]),
288-
set(posix.getgroups()))
291+
set(posix.getgroups() + [posix.getegid()]))
289292

290293
class PosixGroupsTester(unittest.TestCase):
291294

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ Build
141141
Tests
142142
-----
143143

144+
- Issue #10822: Fix test_posix:test_getgroups failure under Solaris. Patch
145+
by Ross Lagerwall.
146+
144147
- Issue #6293: Have regrtest.py echo back sys.flags. This is done by default
145148
in whole runs and enabled selectively using ``--header`` when running an
146149
explicit list of tests. Original patch by Collin Winter.

0 commit comments

Comments
 (0)