[issue19742] pathlib group unittests can fail

Guido van Rossum report at bugs.python.org
Sun Nov 24 01:45:29 CET 2013


New submission from Guido van Rossum:

When running test_pathlib on my OSX (10.8) laptop I get these errors:

======================================================================
ERROR: test_group (test.test_pathlib.PathTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/guido/cpython/Lib/test/test_pathlib.py", line 1332, in test_group
    name = grp.getgrgid(gid).gr_name
KeyError: 'getgrgid(): gid not found: 849048494'

======================================================================
ERROR: test_group (test.test_pathlib.PosixPathTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/guido/cpython/Lib/test/test_pathlib.py", line 1332, in test_group
    name = grp.getgrgid(gid).gr_name
KeyError: 'getgrgid(): gid not found: 849048494'

----------------------------------------------------------------------

This is probably some kind of OSX quirk where st_gid is set to a group that's not in /etc/groups, because (except briefly during the reboot process) on OS X the /etc configuration files for users/groups do not provide the whole truth.

Sadly I don't know what API to use to get the group name.   "ls -l" doesn't seem to know either.  My home dir has that gid too, so it's not an isolated anomaly. It may well be some kind of corporate thing (it's not really "my" laptop. :-)

----------
assignee: pitrou
messages: 204141
nosy: gvanrossum, pitrou
priority: normal
severity: normal
status: open
title: pathlib group unittests can fail
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19742>
_______________________________________


More information about the Python-bugs-list mailing list