Skip to content

Commit 00508a7

Browse files
authored
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.
1 parent c64a1a6 commit 00508a7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/test/test_embed.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,11 @@ def module_search_paths(self, prefix=None, exec_prefix=None):
10421042
def tmpdir_with_python(self):
10431043
# Temporary directory with a copy of the Python program
10441044
with tempfile.TemporaryDirectory() as tmpdir:
1045+
# bpo-38234: On macOS and FreeBSD, the temporary directory
1046+
# can be symbolic link. For example, /tmp can be a symbolic link
1047+
# to /var/tmp. Call realpath() to resolve all symbolic links.
1048+
tmpdir = os.path.realpath(tmpdir)
1049+
10451050
if MS_WINDOWS:
10461051
# Copy pythonXY.dll (or pythonXY_d.dll)
10471052
ver = sys.version_info

0 commit comments

Comments
 (0)