python3/backport-33455-Pass-os.environ-in-test_posix-test_specify.patch
2021-05-25 05:10:34 -04:00

36 lines
1.3 KiB
Diff

From af40fb24e5ae3a462da9ea43529030eb05f487c8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Fri, 11 May 2018 07:40:43 +0200
Subject: [PATCH] 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.
Conflict:NA
Reference:https://github.com/python/cpython/commit/7ec8f28656ea9d84048e9b5655375c6a74a59f53
Signed-off-by: hanxinke <hanxinke@huawei.com>
---
Lib/test/test_posix.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 5063a56..e2cda33 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -1545,7 +1545,7 @@ class TestPosixSpawn(unittest.TestCase):
"""
pid = posix.posix_spawn(sys.executable,
[sys.executable, '-c', script],
- {'foo': 'bar'})
+ {**os.environ, 'foo': 'bar'})
self.assertEqual(os.waitpid(pid, 0), (pid, 0))
with open(envfile) as f:
self.assertEqual(f.read(), 'bar')
--
2.23.0