Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ Optimizations
Deprecated
==========

* :mod:`grp`: Deprecate passing keyword arguments to :func:`grp.getgrgid` and
:func:`grp.getgrnam` functions.
(Contributed by Victor Stinner in :gh:`117873`.)


Removed
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:mod:`grp`: Deprecate passing keyword arguments to :func:`grp.getgrgid` and
:func:`grp.getgrnam` functions. Patch by Victor Stinner.
42 changes: 41 additions & 1 deletion Modules/clinic/grpmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Modules/grpmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ mkgrent(PyObject *module, struct group *p)
grp.getgrgid

id: object
/ [from 3.16]

Return the group database entry for the given numeric group ID.

Expand All @@ -122,7 +123,7 @@ If id is not valid, raise KeyError.

static PyObject *
grp_getgrgid_impl(PyObject *module, PyObject *id)
/*[clinic end generated code: output=30797c289504a1ba input=15fa0e2ccf5cda25]*/
/*[clinic end generated code: output=30797c289504a1ba input=b0f482517fa9c22a]*/
{
PyObject *retval = NULL;
int nomem = 0;
Expand Down Expand Up @@ -194,6 +195,7 @@ grp_getgrgid_impl(PyObject *module, PyObject *id)
grp.getgrnam

name: unicode
/ [from 3.16]

Return the group database entry for the given group name.

Expand All @@ -202,7 +204,7 @@ If name is not valid, raise KeyError.

static PyObject *
grp_getgrnam_impl(PyObject *module, PyObject *name)
/*[clinic end generated code: output=67905086f403c21c input=08ded29affa3c863]*/
/*[clinic end generated code: output=67905086f403c21c input=bbcdbc9a8786c117]*/
{
char *buf = NULL, *buf2 = NULL, *name_chars;
int nomem = 0;
Expand Down