From 21834879218b981f62e3943da5eb8158a7767938 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 25 Sep 2019 16:09:59 +0200 Subject: [PATCH] bpo-38234: Fix test_embed pathconfig tests 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. --- Lib/test/test_embed.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index e7a10b6defea1b..ed90fc0cbed0cd 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -1042,6 +1042,11 @@ def module_search_paths(self, prefix=None, exec_prefix=None): 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