changeset: 102669:a95d98086621 user: Ned Deily date: Mon Aug 15 14:40:38 2016 -0400 files: Misc/NEWS Modules/posixmodule.c description: Issue #27736: Prevent segfault after interpreter re-initialization due to ref count problem introduced in code for Issue #27038 in 3.6.0a3. Patch by Xiang Zhang. diff -r ddc4bdae5e41 -r a95d98086621 Misc/NEWS --- a/Misc/NEWS Mon Aug 15 14:37:14 2016 -0400 +++ b/Misc/NEWS Mon Aug 15 14:40:38 2016 -0400 @@ -57,6 +57,10 @@ Library ------- +- Issue #27736: Prevent segfault after interpreter re-initialization due + to ref count problem introduced in code for Issue #27038 in 3.6.0a3. + Patch by Xiang Zhang. + - Issue #12345: Add mathemathcal constant tau to math and cmath. See also PEP 628. diff -r ddc4bdae5e41 -r a95d98086621 Modules/posixmodule.c --- a/Modules/posixmodule.c Mon Aug 15 14:37:14 2016 -0400 +++ b/Modules/posixmodule.c Mon Aug 15 14:40:38 2016 -0400 @@ -13355,6 +13355,8 @@ Py_DECREF(unicode); } PyModule_AddObject(m, "_have_functions", list); + + Py_INCREF((PyObject *) &DirEntryType); PyModule_AddObject(m, "DirEntry", (PyObject *)&DirEntryType); initialized = 1;