[New-bugs-announce] [issue11249] Memory mismanagement with Py_tp_doc

Martin v. Löwis report at bugs.python.org
Sat Feb 19 17:38:32 CET 2011

New submission from Martin v. Löwis <martin at v.loewis.de>:

Currently, memory management for the Py_tp_doc slot in PyType_FromSpec is ill-defined. The doc string being passed is stored in the type object as-is, but later released with PyObject_Free. To make this consistent, PyType_FromSpec should copy the string, so that it's guaranteed that relasing the memory matches allocation.

Without this patch, users will have to hold onto the type objects they get from PyType_FromSpec "forever".

files: tp_doc.diff
keywords: patch
messages: 128857
nosy: loewis
priority: release blocker
severity: normal
status: open
title: Memory mismanagement with Py_tp_doc
Added file: http://bugs.python.org/file20797/tp_doc.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list