New submission from STINNER Victor <victor.stin...@gmail.com>: PyObject_GenericSetAttr() doesn't keep a reference to the descriptor: Python does crash if the descriptor is destroyed while the attribute is set. Attached patch keeps a reference to the desriptor to avoid the crash.
A smililar was done in PyObject_GenericGetAttr() 8 years with the changelog "fix obscure crash in descriptor handling", see the changeset 941d49a65f06. The patch fixes Lib/test/crashers/borrowed_ref_2.py and so removes it. ---------- files: type_lookup_ref.patch keywords: patch messages: 155025 nosy: haypo priority: normal severity: normal status: open title: Don't rely on borrowed _PyType_Lookup() reference in PyObject_GenericSetAttr() Added file: http://bugs.python.org/file24746/type_lookup_ref.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14211> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com