https://github.com/python/cpython/commit/37f4276351d86dede54c668c6ca29b8d3eef2058 commit: 37f4276351d86dede54c668c6ca29b8d3eef2058 branch: 3.15 author: Miss Islington (bot) <[email protected]> committer: zooba <[email protected]> date: 2026-11-03T17:47:33Z summary:
[3.15] gh-159118: Use multithreaded COM initialization in _wmi (GH-159463) gh-159118: Use multithreaded COM initialization in _wmi (GH-159463) (cherry picked from commit 99799a9d3068e857cd025fcf320ac8863c99ff3e) Co-authored-by: Uttam Bhadauriya <[email protected]> files: A Misc/NEWS.d/next/Windows/2026-10-15-18-45-00.gh-issue-159118.wmiMTA.rst M PC/_wmimodule.cpp diff --git a/Misc/NEWS.d/next/Windows/2026-10-15-18-45-00.gh-issue-159118.wmiMTA.rst b/Misc/NEWS.d/next/Windows/2026-10-15-18-45-00.gh-issue-159118.wmiMTA.rst new file mode 100644 index 000000000000000..561a5005b759755 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2026-10-15-18-45-00.gh-issue-159118.wmiMTA.rst @@ -0,0 +1 @@ +Fix a crash (``RPC_NT_INTERNAL_ERROR``) and intermittent window class failures in :mod:`!_wmi` under high concurrency and load by initializing COM as multi-threaded (MTA) instead of apartment-threaded (STA). diff --git a/PC/_wmimodule.cpp b/PC/_wmimodule.cpp index b9a229b1398ec8d..a546313529fd1b1 100644 --- a/PC/_wmimodule.cpp +++ b/PC/_wmimodule.cpp @@ -67,7 +67,7 @@ _query_thread(LPVOID param) } if (SUCCEEDED(hr)) { - hr = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); } if (FAILED(hr)) { _______________________________________________ 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]
