diff -r 93fc0a13b7e8 -r 825d5a5907b4 mercurial/exewrapper.c --- a/mercurial/exewrapper.c Thu May 20 19:59:03 2021 -0400 +++ b/mercurial/exewrapper.c Tue May 11 01:05:38 2021 -0400 @@ -48,7 +48,7 @@ int(__cdecl * Py_Main)(int argc, TCHAR *argv[]); #if PY_MAJOR_VERSION >= 3 - Py_LegacyWindowsStdioFlag = 1; + _wputenv(L"PYTHONLEGACYWINDOWSSTDIO=1"); #endif if (GetModuleFileName(NULL, pyscript, _countof(pyscript)) == 0) {