There was an error while loading. Please reload this page.
2 parents 14a88ab + f4bbc53 commit 687592dCopy full SHA for 687592d
1 file changed
Lib/test/test_cmd_line.py
@@ -271,7 +271,11 @@ def test_empty_PYTHONPATH_issue16309(self):
271
272
def test_displayhook_unencodable(self):
273
for encoding in ('ascii', 'latin-1', 'utf-8'):
274
- env = os.environ.copy()
+ # We are testing a PYTHON environment variable here, so we can't
275
+ # use -E, -I, or script_helper (which uses them). So instead we do
276
+ # poor-man's isolation by deleting the PYTHON vars from env.
277
+ env = {key:value for (key,value) in os.environ.copy().items()
278
+ if not key.startswith('PYTHON')}
279
env['PYTHONIOENCODING'] = encoding
280
p = subprocess.Popen(
281
[sys.executable, '-i'],
0 commit comments