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. :-)
You should be able to find the group and group name using the "Directory Utility" app. The easiest way to launch it is from a shell with: open "/System/Library/CoreServices/Directory Utility.app" There is a command line utility, dscl, but it is much more painful.