https://github.com/python/cpython/commit/46a54e5e6978d07f3396b48bf2bcbd1bf193e44f
commit: 46a54e5e6978d07f3396b48bf2bcbd1bf193e44f
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: JelleZijlstra <[email protected]>
date: 2026-10-20T18:30:42Z
summary:

[3.14] gh-159739: Track group records for cyclic garbage collection (GH-159778) 
(#159905)



(cherry picked from commit c2deb791c5381b2c97db4b92e0289ad9c60460ff)

Co-authored-by: Jelle Zijlstra <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>

files:
A Misc/NEWS.d/next/Library/2026-10-19-20-38-17.gh-issue-159739.bc65da.rst
M Modules/grpmodule.c

diff --git 
a/Misc/NEWS.d/next/Library/2026-10-19-20-38-17.gh-issue-159739.bc65da.rst 
b/Misc/NEWS.d/next/Library/2026-10-19-20-38-17.gh-issue-159739.bc65da.rst
new file mode 100644
index 00000000000000..fd831b6907e777
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2026-10-19-20-38-17.gh-issue-159739.bc65da.rst
@@ -0,0 +1,2 @@
+Allow cyclic garbage collection to reclaim group records returned by
+:mod:`grp`.
diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c
index 652958618a2c4c..d92f09f592536e 100644
--- a/Modules/grpmodule.c
+++ b/Modules/grpmodule.c
@@ -111,6 +111,7 @@ mkgrent(PyObject *module, struct group *p)
         return NULL;
     }
 
+    PyObject_GC_Track(v);
     return v;
 }
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to