From 91640abb2bd35fe1f22feb8ad4e13d41d7d0d07a Mon Sep 17 00:00:00 2001
From: Prithviraj Chaudhuri
Date: Thu, 20 Nov 2025 09:35:22 -0500
Subject: [PATCH] gh-140042: Removing unsafe call to sqlite3_shutdown
(GH-141690)
(cherry picked from commit b1558b6d3e2af8964840a5c00356533107368f22)
---
.../next/C API/2025-11-18-04-16-09.gh-issue-140042.S1C7id.rst | 1 +
Modules/_sqlite/module.c | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
create mode 100644 Misc/NEWS.d/next/C API/2025-11-18-04-16-09.gh-issue-140042.S1C7id.rst
diff --git a/Misc/NEWS.d/next/C API/2025-11-18-04-16-09.gh-issue-140042.S1C7id.rst b/Misc/NEWS.d/next/C API/2025-11-18-04-16-09.gh-issue-140042.S1C7id.rst
new file mode 100644
index 00000000000000..608e806b431372
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2025-11-18-04-16-09.gh-issue-140042.S1C7id.rst
@@ -0,0 +1 @@
+Removed the sqlite3_shutdown call that could cause closing connections for sqlite when used with multiple sub interpreters.
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index 2c25ee32e58189..3d828abdd80edb 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -751,7 +751,6 @@ module_exec(PyObject *module)
return 0;
error:
- sqlite3_shutdown();
return -1;
}