On Wed, Apr 27, 2016 at 10:14 AM, Serhiy Storchaka <storch...@gmail.com> wrote: > I think that we can resolve this issue by following steps: > > 1. Add a new function PyModule_AddObject2(), that steals a reference even on > failure.
+1 It would be good to document PyModule_AddObject's current behavior in 3.5+ (already attached a patch). > 2. Introduce a special macro like PY_SSIZE_T_CLEAN (any suggestions about a > name?). If it is defined, define PyModule_AddObject as PyModule_AddObject2. > Define this macro before including Python.h in all CPython modules except > _json, _io, and _tkinter. +1 > 3. Make old PyModule_AddObject to emit a warning about possible leak and a > suggestion to define above macro. +0 _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com