diff --git a/Misc/NEWS b/Misc/NEWS index 0f4d90ee463..d81de709981 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -778,6 +778,9 @@ Core and Builtins Library ------- +- Issue #6865: Fix reference counting issue in the initialization of the pwd + module. + - Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an exception. diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c index a271c5a82eb..2865dc6bf41 100644 --- a/Modules/pwdmodule.c +++ b/Modules/pwdmodule.c @@ -194,6 +194,7 @@ initpwd(void) Py_INCREF((PyObject *) &StructPwdType); PyModule_AddObject(m, "struct_passwd", (PyObject *) &StructPwdType); /* And for b/w compatibility (this was defined by mistake): */ + Py_INCREF((PyObject *) &StructPwdType); PyModule_AddObject(m, "struct_pwent", (PyObject *) &StructPwdType); initialized = 1; }