Author vstinner
Recipients eric.snow, ncoghlan, vstinner
Date 2017-06-08.10:48:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496918920.92.0.347737718278.issue30598@psf.upfronthosting.co.za>
In-reply-to
Content
Recently, the Python initialization was reworked to start to implement the PEP 432:

- bpo-22257: commits 1abcf6700b4da6207fe859de40c6c1bada6b4fec and 6b4be195cd8868b76eb6fbe166acc39beee8ce36

Now, Py_NewInterpreter() leaks a reference on warnoptions in _PySys_EndInit(). We tried with St├ęphane Wirtel and Louie Lu to add Py_DECREF(warnoptions), but test_capi does crash with this change.

The problem is that warnoptions is stored in a C global variable *and* in sys.warnoptions of each interpreter. The ownership of this variable is unclear.

I don't think that it's a good idea to share a list between two interpreters and so I created this issue to propose to redesign this variable.

The tricky part is that the C global variable is also accessed by 2 public C functions: PySys_ResetWarnOptions() and PySys_AddWarnOptionUnicode().
History
Date User Action Args
2017-06-08 10:48:40vstinnersetrecipients: + vstinner, ncoghlan, eric.snow
2017-06-08 10:48:40vstinnersetmessageid: <1496918920.92.0.347737718278.issue30598@psf.upfronthosting.co.za>
2017-06-08 10:48:40vstinnerlinkissue30598 messages
2017-06-08 10:48:40vstinnercreate