Skip to content

Commit 12dc518

Browse files
committed
fix: Fix normalization of extension paths on the annoying operating system and Python 3.13
Python 3.13 changed `os.path.isabs`: > On Windows, `isabs()` no longer considers paths starting with exactly one slash (`\` or `/`) to be absolute. See https://docs.python.org/3/whatsnew/3.13.html#os-path.
1 parent 6c5b5c3 commit 12dc518

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/mkdocstrings_handlers/python/handler.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -469,11 +469,9 @@ def normalize_extension_paths(self, extensions: Sequence) -> Sequence:
469469
pth = str(ext)
470470
options = None
471471

472-
if pth.endswith(".py") or ".py:" in pth or "/" in pth or "\\" in pth: # noqa: SIM102
473-
# This is a sytem path. Normalize it.
474-
if not os.path.isabs(pth):
475-
# Make path absolute relative to config file path.
476-
pth = os.path.normpath(os.path.join(base_path, pth))
472+
if pth.endswith(".py") or ".py:" in pth or "/" in pth or "\\" in pth:
473+
# This is a system path. Normalize it, make it absolute relative to config file path.
474+
pth = os.path.abspath(os.path.join(base_path, pth))
477475

478476
if options is not None:
479477
normalized.append({pth: options})

0 commit comments

Comments
 (0)