Skip to content

Commit 77645a1

Browse files
committed
bpo-33455: Pass os.environ in test_posix::test_specify_environment
Pass os.environ's copy to new process created at test_posix: test_specify_environment. Otherwise important variables such as LD_LIBRARY_PATH are not set and the child process might not work at all in an environment where such variables are required for Python to function.
1 parent df00f04 commit 77645a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_posix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ def test_specify_environment(self):
14621462
"""
14631463
pid = posix.posix_spawn(sys.executable,
14641464
[sys.executable, '-c', script],
1465-
{'foo': 'bar'})
1465+
{**os.environ, 'foo': 'bar'})
14661466
self.assertEqual(os.waitpid(pid, 0), (pid, 0))
14671467
with open(envfile) as f:
14681468
self.assertEqual(f.read(), 'bar')

0 commit comments

Comments
 (0)