Skip to content

Commit

Permalink
manifest: Fix absolute path checking on windows for Python 3.13
Browse files Browse the repository at this point in the history
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 <pieter.degendt@basalte.be>
  • Loading branch information
pdgendt committed Oct 11, 2024
1 parent 42c0a5d commit 655648f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/west/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2421,7 +2421,9 @@ def _load_project(self, pd: Dict, url_bases: Dict[str, str],
# symbolic links.
ret_norm = os.path.normpath(ret.path)

if os.path.isabs(ret_norm):
# Python 3.13 os.path.isabs on Windows returns False for a single
# leading (back)slash.
if ret_norm.startswith('/') or os.path.isabs(ret_norm):
self._malformed(f'project "{ret.name}" has absolute path '
f'{ret.path}; this must be relative to the '
f'workspace topdir' +
Expand Down

0 comments on commit 655648f

Please sign in to comment.