[Python-checkins] bpo-38234: Fix test_embed pathconfig tests (GH-16390)

Victor Stinner webhook-mailer at python.org
Wed Sep 25 10:30:40 EDT 2019


https://github.com/python/cpython/commit/00508a7407d7d300b487532e2271534b20e378a7
commit: 00508a7407d7d300b487532e2271534b20e378a7
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2019-09-25T16:30:36+02:00
summary:

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.

files:
M Lib/test/test_embed.py

diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py
index e7a10b6defea..ed90fc0cbed0 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



More information about the Python-checkins mailing list