https://github.com/python/cpython/commit/c2deb791c5381b2c97db4b92e0289ad9c60460ff
commit: c2deb791c5381b2c97db4b92e0289ad9c60460ff
branch: main
author: Jelle Zijlstra <[email protected]>
committer: JelleZijlstra <[email protected]>
date: 2026-10-20T10:20:07-07:00
summary:

gh-159739: Track group records for cyclic garbage collection (#159778)



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 fe1d16d8322005..5404250ee7387f 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