Author vstinner
Recipients eric.snow, ncoghlan, vstinner
Date 2017-06-08.10:48:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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().
Date User Action Args
2017-06-08 10:48:40vstinnersetrecipients: + vstinner, ncoghlan, eric.snow
2017-06-08 10:48:40vstinnersetmessageid: <>
2017-06-08 10:48:40vstinnerlinkissue30598 messages
2017-06-08 10:48:40vstinnercreate