Skip to content
Snippets Groups Projects
Commit c3edf68bea75 authored by Matt Harbison's avatar Matt Harbison
Browse files

windows: stop enabling legacy stdio by default in the `hg` executable

We need to stop doing this in order to exercize the new code in the previous
commit.  The environment variable can still be manually set to revert to the
previous state of things that has been used since py3 support was added, for
now.  We should try to get away from it entirely though, because this problem
affects more than what is written up in issue6952.[1]

I've tested locally with the `hg.exe` form of this, and the tests pass.  That
gives me some hope, but 1) the pager wouldn't typically be used in tests due to
the runner capturing the output, unless a pager is explicitly requested (like a
few tests do), and 2) the tests are basically all ascii characters anyway, so
that's kind of hard to screw up.  (The test runner sets `HGENCODING=ascii`, I
assume for portability, so that's unlikely to change.  I've also managed to
generate corrupt file names when trying to write a test for an issue with
non-ascii file names[2], using code that works perfectly fine outside the test
runner.  But we do seem to be getting the output that was previously missing,
and the project CI system will cover `hg.bat` when it tests the wheels.)

[1] mercurial/tortoisehg/thg#5854
[2] mercurial/tortoisehg/thg#5923
parent 40c956a683a4
No related branches found
No related tags found
1 merge request!1193windows: effect of PYTHONLEGACYWINDOWSSTDIO when not defined
......@@ -4,8 +4,6 @@
setlocal
set HG=%~f0
set PYTHONLEGACYWINDOWSSTDIO=1
rem Use a full path to Python (relative to this script) if it exists,
rem as the standard Python install does not put python.exe on the PATH...
rem Otherwise, expect that python.exe can be found on the PATH.
......
......@@ -47,10 +47,6 @@
void(__cdecl * Py_SetPythonHome)(TCHAR * home);
int(__cdecl * Py_Main)(int argc, TCHAR *argv[]);
#if PY_MAJOR_VERSION >= 3
_wputenv(L"PYTHONLEGACYWINDOWSSTDIO=1");
#endif
if (GetModuleFileName(NULL, pyscript, _countof(pyscript)) == 0) {
err = "GetModuleFileName failed";
goto bail;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment