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

Skip to content

Commit ca9bfe1

Browse files
committed
Issue #10433: merge
2 parents cfc104e + 2e20968 commit ca9bfe1

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Doc/library/os.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,20 @@ process and user.
238238

239239
Availability: Unix.
240240

241+
.. note:: On Mac OS X, :func:`getgroups` behavior differs somewhat from
242+
other Unix platforms. If the Python interpreter was built with a
243+
deployment target of :const:`10.5` or earlier, :func:`getgroups` returns
244+
the list of effective group ids associated with the current user process;
245+
this list is limited to a system-defined number of entries, typically 16,
246+
and may be modified by calls to :func:`setgroups` if suitably privileged.
247+
If built with a deployment target greater than :const:`10.5`,
248+
:func:`getgroups` returns the current group access list for the user
249+
associated with the effective user id of the process; the group access
250+
list may change over the lifetime of the process, it is not affected by
251+
calls to :func:`setgroups`, and its length is not limited to 16. The
252+
deployment target value, :const:`MACOSX_DEPLOYMENT_TARGET`, can be
253+
obtained with :func:`sysconfig.get_config_var`.
254+
241255

242256
.. function:: initgroups(username, gid)
243257

@@ -425,6 +439,10 @@ process and user.
425439

426440
Availability: Unix.
427441

442+
.. note:: On Mac OS X, the length of *groups* may not exceed the
443+
system-defined maximum number of effective group ids, typically 16.
444+
See the documentation for :func:`getgroups` for cases where it may not
445+
return the same group list set by calling setgroups().
428446

429447
.. function:: setpgrp()
430448

0 commit comments

Comments
 (0)