Patchwork [2,of,5] py3: spawn all python instances with legacy stdio enabled on Windows

login
register
mail settings
Submitter Matt Harbison
Date Dec. 18, 2018, 6:56 a.m.
Message ID <a73e76d721fdd67ad51c.1545116168@Envy>
Download mbox | patch
Permalink /patch/37228/
State Accepted
Headers show

Comments

Matt Harbison - Dec. 18, 2018, 6:56 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1545089118 18000
#      Mon Dec 17 18:25:18 2018 -0500
# Node ID a73e76d721fdd67ad51cad9bd8faf28ae0c48ec6
# Parent  f8c0ef3b994fd0d0f15129067fa59ad72d9bdd66
py3: spawn all python instances with legacy stdio enabled on Windows

This fixes 6 more tests.  See ef7119cd4965.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1106,6 +1106,12 @@  class Test(unittest.TestCase):
         # IP addresses.
         env['LOCALIP'] = _strpath(self._localip())
 
+        # This has the same effect as Py_LegacyWindowsStdioFlag in exewrapper.c,
+        # but this is needed for testing python instances like dummyssh,
+        # dummysmtpd.py, and dumbhttp.py.
+        if PYTHON3 and os.name == 'nt':
+            env['PYTHONLEGACYWINDOWSSTDIO'] = '1'
+
         # Reset some environment variables to well-known values so that
         # the tests produce repeatable output.
         env['LANG'] = env['LC_ALL'] = env['LANGUAGE'] = 'C'