Skip to content

Commit eb52ac8

Browse files
authored
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).
1 parent d79c1d4 commit eb52ac8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎Lib/test/test_capi.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ def test_subinterps_distinct_state(self):
480480

481481
def test_forced_io_encoding(self):
482482
# Checks forced configuration of embedded interpreter IO streams
483-
env = {"PYTHONIOENCODING": "utf-8:surrogateescape"}
483+
env = dict(os.environ, PYTHONIOENCODING="utf-8:surrogateescape")
484484
out, err = self.run_embedded_interpreter("forced_io_encoding", env=env)
485485
if support.verbose > 1:
486486
print()

0 commit comments

Comments
 (0)