Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3cc5ae5

Browse filesBrowse files
authored
gh-85283: Convert grp extension to the limited C API (#116611)
posixmodule.h: remove check on the limited C API, since these helpers are not part of the public C API.
1 parent ba13215 commit 3cc5ae5
Copy full SHA for 3cc5ae5

File tree

Expand file treeCollapse file tree

8 files changed

+20
-88
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+20
-88
lines changed

‎Include/internal/pycore_global_objects_fini_generated.h

Copy file name to clipboardExpand all lines: Include/internal/pycore_global_objects_fini_generated.h
-1Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Include/internal/pycore_global_strings.h

Copy file name to clipboardExpand all lines: Include/internal/pycore_global_strings.h
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@ struct _Py_global_strings {
472472
STRUCT_FOR_ID(hi)
473473
STRUCT_FOR_ID(hook)
474474
STRUCT_FOR_ID(hour)
475-
STRUCT_FOR_ID(id)
476475
STRUCT_FOR_ID(ident)
477476
STRUCT_FOR_ID(identity_hint)
478477
STRUCT_FOR_ID(ignore)

‎Include/internal/pycore_runtime_init_generated.h

Copy file name to clipboardExpand all lines: Include/internal/pycore_runtime_init_generated.h
-1Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Include/internal/pycore_unicodeobject_generated.h

Copy file name to clipboardExpand all lines: Include/internal/pycore_unicodeobject_generated.h
-3Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Modules/clinic/grpmodule.c.h

Copy file name to clipboardExpand all lines: Modules/clinic/grpmodule.c.h
+11-75Lines changed: 11 additions & 75 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Modules/grpmodule.c

Copy file name to clipboardExpand all lines: Modules/grpmodule.c
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
21
/* UNIX group file access module */
32

4-
// clinic/grpmodule.c.h uses internal pycore_modsupport.h API
5-
#ifndef Py_BUILD_CORE_BUILTIN
6-
# define Py_BUILD_CORE_MODULE 1
3+
// Need limited C API version 3.13 for PyMem_RawRealloc()
4+
#include "pyconfig.h" // Py_GIL_DISABLED
5+
#ifndef Py_GIL_DISABLED
6+
#define Py_LIMITED_API 0x030d0000
77
#endif
88

99
#include "Python.h"
1010
#include "posixmodule.h"
1111

12+
#include <errno.h> // ERANGE
1213
#include <grp.h> // getgrgid_r()
14+
#include <string.h> // memcpy()
1315
#include <unistd.h> // sysconf()
1416

1517
#include "clinic/grpmodule.c.h"
@@ -88,7 +90,7 @@ mkgrent(PyObject *module, struct group *p)
8890
Py_DECREF(x);
8991
}
9092

91-
#define SET(i,val) PyStructSequence_SET_ITEM(v, i, val)
93+
#define SET(i,val) PyStructSequence_SetItem(v, i, val)
9294
SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_name));
9395
if (p->gr_passwd)
9496
SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_passwd));

‎Modules/posixmodule.h

Copy file name to clipboardExpand all lines: Modules/posixmodule.h
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#ifndef Py_POSIXMODULE_H
44
#define Py_POSIXMODULE_H
5-
#ifndef Py_LIMITED_API
65
#ifdef __cplusplus
76
extern "C" {
87
#endif
@@ -34,5 +33,4 @@ extern int _Py_Sigset_Converter(PyObject *, void *);
3433
#ifdef __cplusplus
3534
}
3635
#endif
37-
#endif // !Py_LIMITED_API
3836
#endif // !Py_POSIXMODULE_H

‎Tools/c-analyzer/cpython/ignored.tsv

Copy file name to clipboardExpand all lines: Tools/c-analyzer/cpython/ignored.tsv
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,3 +740,5 @@ Modules/expat/xmlrole.c - error -
740740
Modules/_io/_iomodule.c - _PyIO_Module -
741741
Modules/_sqlite/module.c - _sqlite3module -
742742
Modules/clinic/md5module.c.h _md5_md5 _keywords -
743+
Modules/clinic/grpmodule.c.h grp_getgrgid _keywords -
744+
Modules/clinic/grpmodule.c.h grp_getgrnam _keywords -

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.