From: Victor Stinner Date: Tue, 13 Jun 2017 09:49:44 +0000 (+0200) Subject: bpo-28180: Fix test_capi.test_forced_io_encoding() (#2155) X-Git-Tag: v3.7.0a1~610 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb52ac89929bb09b15c014ab8ff60eee685e86c7;p=python bpo-28180: Fix test_capi.test_forced_io_encoding() (#2155) Don't run Python in an empty environment, but copy the current environment and set PYTHONIOENCODING. So the test works also on Python compiled in shared mode (using libpython). --- diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index c4a9766429..1cf5cd73f0 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -480,7 +480,7 @@ class EmbeddingTests(unittest.TestCase): def test_forced_io_encoding(self): # Checks forced configuration of embedded interpreter IO streams - env = {"PYTHONIOENCODING": "utf-8:surrogateescape"} + env = dict(os.environ, PYTHONIOENCODING="utf-8:surrogateescape") out, err = self.run_embedded_interpreter("forced_io_encoding", env=env) if support.verbose > 1: print()