Skip to content

Commit 85fd597

Browse files
committed
manifest: Fix absolute path checking on windows for Python 3.13
Python 3.13 changed the behavior for os.path.isabs https://docs.python.org/3/library/os.path.html#os.path.isabs Prevent absolute paths that start with a '/'. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 42c0a5d commit 85fd597

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/west/manifest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2421,7 +2421,10 @@ def _load_project(self, pd: Dict, url_bases: Dict[str, str],
24212421
# symbolic links.
24222422
ret_norm = os.path.normpath(ret.path)
24232423

2424-
if os.path.isabs(ret_norm):
2424+
# To be "really" absolute, a Windows path must include the "drive" like C:\\, D:\\.
2425+
# But here we also want to block drive-less "half-breeds".
2426+
# Note this question has confused Python which changed the `.isabs()` behavior in 3.13
2427+
if ret_norm[0] in '/\\' or os.path.isabs(ret_norm):
24252428
self._malformed(f'project "{ret.name}" has absolute path '
24262429
f'{ret.path}; this must be relative to the '
24272430
f'workspace topdir' +

0 commit comments

Comments
 (0)