bpo-40014: Fix os.getgrouplist() on macOS (GH-19118)


On macOS, getgrouplist() returns a non-zero value without setting
errno if the group list is too small. Double the list size and call
it again in this case.
(cherry picked from commit 8ec7370c89aa522602eb9604086ce9f09770953d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 files changed