From 343c65569696b12b58e94a04a4b9f72cb8fcecef Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Sat, 24 Oct 2026 17:34:40 -0400 Subject: [PATCH] gh-160624: Stop embedding a manifest in Windows DLLs and extension modules Windows can't load a DLL with an embedded manifest from a path near MAX_PATH, even with long paths enabled, so python.exe failed to start from long paths. The manifest has no effect in a DLL. The executables keep theirs. Co-Authored-By: Claude Opus 5.5 --- .../2026-10-24-17-34-22.gh-issue-160624.0izYfQ.rst | 4 ++++ PC/python_nt.rc | 10 ---------- PC/sqlite3.rc | 10 ---------- 3 files changed, 4 insertions(+), 20 deletions(-) create mode 100644 Misc/NEWS.d/next/Windows/2026-10-24-17-34-22.gh-issue-160624.0izYfQ.rst diff --git a/Misc/NEWS.d/next/Windows/2026-10-24-17-34-22.gh-issue-160624.0izYfQ.rst b/Misc/NEWS.d/next/Windows/2026-10-24-17-34-22.gh-issue-160624.0izYfQ.rst new file mode 100644 index 000000000000000..97f8c37f4b9e409 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2026-10-24-17-34-22.gh-issue-160624.0izYfQ.rst @@ -0,0 +1,4 @@ +Stop embedding a manifest in the Python DLL, extension modules and +``sqlite3.dll``. The manifest had no effect in a DLL, and it prevented +Python from starting or importing those modules from paths close to +``MAX_PATH`` characters, even with long paths enabled. diff --git a/PC/python_nt.rc b/PC/python_nt.rc index ae64fbd217af740..67c375fffc3caf2 100644 --- a/PC/python_nt.rc +++ b/PC/python_nt.rc @@ -2,16 +2,6 @@ #include "python_ver_rc.h" -#ifndef RT_MANIFEST -// bpo-45220: Cannot reliably #include RT_MANIFEST from -// anywhere, so we hardcode it -#define RT_MANIFEST 24 -#endif - -// Include the manifest file that indicates we support all -// current versions of Windows. -2 RT_MANIFEST "python.manifest" - ///////////////////////////////////////////////////////////////////////////// // // Version diff --git a/PC/sqlite3.rc b/PC/sqlite3.rc index 9ae2aa0f6f2f2cc..305c593c9603792 100644 --- a/PC/sqlite3.rc +++ b/PC/sqlite3.rc @@ -2,16 +2,6 @@ #include -#ifndef RT_MANIFEST -// bpo-45220: Cannot reliably #include RT_MANIFEST from -// anywhere, so we hardcode it -#define RT_MANIFEST 24 -#endif - -// Include the manifest file that indicates we support all -// current versions of Windows. -2 RT_MANIFEST "python.manifest" - ///////////////////////////////////////////////////////////////////////////// // // Version