summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-09-25 14:30:36 (GMT)
committerGitHub <noreply@github.com>2019-09-25 14:30:36 (GMT)
commit00508a7407d7d300b487532e2271534b20e378a7 (patch)
tree85b12c1363cc016ad17c13c0a81c309d5b2c21fe /Lib/test
parentc64a1a61e6fc542cada40eb069a239317e1af36e (diff)
downloadcpython-00508a7407d7d300b487532e2271534b20e378a7.zip
cpython-00508a7407d7d300b487532e2271534b20e378a7.tar.gz
cpython-00508a7407d7d300b487532e2271534b20e378a7.tar.bz2
bpo-38234: Fix test_embed pathconfig tests (GH-16390)
bpo-38234: On macOS and FreeBSD, the temporary directory can be symbolic link. For example, /tmp can be a symbolic link to /var/tmp. Call realpath() to resolve all symbolic links.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_embed.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py
index e7a10b6..ed90fc0 100644
--- a/Lib/test/test_embed.py
+++ b/Lib/test/test_embed.py
@@ -1042,6 +1042,11 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
def tmpdir_with_python(self):
# Temporary directory with a copy of the Python program
with tempfile.TemporaryDirectory() as tmpdir:
+ # bpo-38234: On macOS and FreeBSD, the temporary directory
+ # can be symbolic link. For example, /tmp can be a symbolic link
+ # to /var/tmp. Call realpath() to resolve all symbolic links.
+ tmpdir = os.path.realpath(tmpdir)
+
if MS_WINDOWS:
# Copy pythonXY.dll (or pythonXY_d.dll)
ver = sys.version_info