[issue7900] posix.getgroups() failure on Mac OS X
report at bugs.python.org
Tue Feb 23 08:20:55 CET 2010
Ronald Oussoren <ronaldoussoren at mac.com> added the comment:
Alexander: What makes you think r63955 introduced the problem?
Btw. This does not crash the interpreter: the example you give causes an exception and cleanly shuts down the interpreter. The exception is unwanted, but I wouldn't call it a crash.
The Apple fix for getgroups in python2.6 is odd, it uses an undocumented API (getgrouplist_2).
If I read the manpage correctly there is a posixly correct way to implement os.getgroups:
* call getgroups(MAX_GROUPS,...)
* if that fails: call getgroups(0,...), the result is groupcount
* allocate an array of groupcount gid_t's and call getgroups(groupcount)
I'll work on a patch that implements this.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list