From 5a3d5ca3e1cb1a29ec7b978f73b4a1f4b90166cb Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 13 Jun 2017 11:21:23 +0200 Subject: [PATCH] bpo-28180: Fix test_capi.test_forced_io_encoding() 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). --- Lib/test/test_capi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index c4a97664290949..1cf5cd73f09391 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -480,7 +480,7 @@ def test_subinterps_distinct_state(self): 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()