[issue7999] setregid does not work with -1 as argument

Alexander Belopolsky report at bugs.python.org
Fri Feb 26 01:44:04 CET 2010


Alexander Belopolsky <alexander.belopolsky at gmail.com> added the comment:

I reproduced this bug on OSX 10.6:

>>> os.setregid(-1,-1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: group id too big

Since -1 has special meaning as an argument to POSIX setregid(rgid, egid),

"""
If rgid is -1, the real group ID shall not be changed; if egid is -1, the effective group ID shall not be changed.
"""

I think passing -1 to os. setregid() should be supported.

Meanwhile the following work-around works for me on OSX, but may not work on other platforms:

>>> os.setregid(2**32-1,2**32-1)

----------
nosy: +Alexander.Belopolsky

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


More information about the Python-bugs-list mailing list