[Python-checkins] bpo-18372: Add missing PyObject_GC_Track() calls in the pickle module (GH-8505)

Miss Islington (bot) webhook-mailer at python.org
Tue Apr 23 08:18:29 EDT 2019


https://github.com/python/cpython/commit/c0f6f5370325459cadd90010530b1d300dce514e
commit: c0f6f5370325459cadd90010530b1d300dce514e
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-04-23T05:18:15-07:00
summary:

bpo-18372: Add missing PyObject_GC_Track() calls in the pickle module (GH-8505)

(cherry picked from commit 359bd4f61b9e1493081f4f67882554247b53926a)

Co-authored-by: Zackery Spytz <zspytz at gmail.com>

files:
A Misc/NEWS.d/next/Core and Builtins/2018-12-08-03-40-43.bpo-18372.DT1nR0.rst
M Modules/_pickle.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-12-08-03-40-43.bpo-18372.DT1nR0.rst b/Misc/NEWS.d/next/Core and Builtins/2018-12-08-03-40-43.bpo-18372.DT1nR0.rst
new file mode 100644
index 000000000000..d8205b8d32d0
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2018-12-08-03-40-43.bpo-18372.DT1nR0.rst	
@@ -0,0 +1,2 @@
+Add missing :c:func:`PyObject_GC_Track` calls in the :mod:`pickle` module.
+Patch by Zackery Spytz.
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 15e15cdf4506..c8b3ef70f521 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -1114,6 +1114,8 @@ _Pickler_New(void)
         Py_DECREF(self);
         return NULL;
     }
+
+    PyObject_GC_Track(self);
     return self;
 }
 
@@ -1491,6 +1493,7 @@ _Unpickler_New(void)
         return NULL;
     }
 
+    PyObject_GC_Track(self);
     return self;
 }
 



More information about the Python-checkins mailing list