summaryrefslogtreecommitdiffstats
path: root/Lib/test/support/os_helper.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-06-05 07:59:47 (GMT)
committerGitHub <noreply@github.com>2022-06-05 07:59:47 (GMT)
commit6f8367d3489eff07139bc908fdf666fc904ca445 (patch)
treec14934c1d16967db99a854819d203385e6e064c8 /Lib/test/support/os_helper.py
parent713eb184b50f2b8b138fb01187ee32fa29a815c9 (diff)
downloadcpython-6f8367d3489eff07139bc908fdf666fc904ca445.zip
cpython-6f8367d3489eff07139bc908fdf666fc904ca445.tar.gz
cpython-6f8367d3489eff07139bc908fdf666fc904ca445.tar.bz2
gh-90473: wasmtime does not support absolute symlinks (GH-93490)
Diffstat (limited to 'Lib/test/support/os_helper.py')
-rw-r--r--Lib/test/support/os_helper.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/support/os_helper.py b/Lib/test/support/os_helper.py
index ed4ec15..5d787f1 100644
--- a/Lib/test/support/os_helper.py
+++ b/Lib/test/support/os_helper.py
@@ -171,9 +171,13 @@ def can_symlink():
global _can_symlink
if _can_symlink is not None:
return _can_symlink
- symlink_path = TESTFN + "can_symlink"
+ # WASI / wasmtime prevents symlinks with absolute paths, see man
+ # openat2(2) RESOLVE_BENEATH. Almost all symlink tests use absolute
+ # paths. Skip symlink tests on WASI for now.
+ src = os.path.abspath(TESTFN)
+ symlink_path = src + "can_symlink"
try:
- os.symlink(TESTFN, symlink_path)
+ os.symlink(src, symlink_path)
can = True
except (OSError, NotImplementedError, AttributeError):
can = False