Skip to content

Commit 6e9456e

Browse files
bpo-33455: Pass os.environ in test_posix::test_specify_environment. (GH-6753)
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. (cherry picked from commit 7ec8f28) Co-authored-by: Miro Hrončok <[email protected]>
1 parent c5444b3 commit 6e9456e

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)