https://github.com/python/cpython/commit/6ea84b2726bb6a1a8a6819d30c368ac34c50eabe
commit: 6ea84b2726bb6a1a8a6819d30c368ac34c50eabe
branch: main
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-02-27T08:02:19Z
summary:

Fix unlikely potential reference leak in _locale._getdefaultlocale (GH-145250)

It occurs in a code which perhaps never executed.

files:
M Modules/_localemodule.c

diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c
index 7174eebd0c94de..f0a418ee5024e3 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -567,7 +567,6 @@ _locale__getdefaultlocale_impl(PyObject *module)
     }
 
     /* cannot determine the language code (very unlikely) */
-    Py_INCREF(Py_None);
     return Py_BuildValue("Os", Py_None, encoding);
 }
 #endif

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to