Windows Mercurial Python 3 Installer.
Tom Hindle
tom_hindle at sil.org
Mon Dec 9 23:57:18 UTC 2019
On 12/2/19 8:33 PM, Matt Harbison wrote:
> One word of caution, you need to run `hg.exe`, not `hg`. I'm not sure
> what's going on (I suspect it's at least in part because the legacy
> stdio environment variable isn't set), but you won't get any output
> from the latter.
Thanks for the warning! I am seeing stdout not giving output when
running hg.exe as well. (using python 3.8) (perhaps I did something
wrong in the build and PYTHONLEGACYWINDOWSSTDIO isn't set in my hg.exe?)
I see in ui._runpager: (mercurial/ui.py)
that:
os.dup2(pager.stdin.fileno(), procutil.stdout.fileno())
and this SO question and python doc explains to me why this causes a
problem:
https://stackoverflow.com/questions/52373180/python-on-windows-handle-invalid-when-redirecting-stdout-writing-to-file
https://docs.python.org/3/library/sys.html
But setting the following fixes running both 'hg.exe' + 'python.exe hg'
set PYTHONLEGACYWINDOWSSTDIO=1
Thanks
More information about the Mercurial
mailing list