[3.14] gh-125434: Display thread name in faulthandler on Windows (#142011)

* gh-125434: Display thread name in faulthandler on Windows (#140675)

(cherry picked from commit 313145eab5)

* gh-125434: Fix non-ASCII thread names in faulthandler on Windows (#140700)

Add _Py_DumpWideString() function to dump a wide string as ASCII. It
supports surrogate pairs.

Replace _Py_EncodeLocaleRaw() with _Py_DumpWideString()
in write_thread_name().

(cherry picked from commit 80f20f58b2)
This commit is contained in:
Victor Stinner 2025-11-27 13:05:37 +01:00 committed by GitHub
parent f47e928574
commit ad60d8963e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 121 additions and 14 deletions

View file

@ -503,6 +503,7 @@ pycore_init_runtime(_PyRuntimeState *runtime,
_PyRuntimeState_SetFinalizing(runtime, NULL);
_Py_InitVersion();
_Py_DumpTraceback_Init();
status = _Py_HashRandomization_Init(config);
if (_PyStatus_EXCEPTION(status)) {