Skip to content

Commit d607389

Browse files
committed
fix: Write paths as strings, not Path instances in sys.path.insert commands
Issue-mkdocstrings-766: mkdocstrings/mkdocstrings#766
1 parent ef77075 commit d607389

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mkdocstrings_handlers/python/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def __init__(self, config: dict[str, Any], base_dir: Path, **kwargs: Any) -> Non
152152
commands = []
153153

154154
if search_paths:
155-
commands.extend([f"sys.path.insert(0, {path!r})" for path in reversed(search_paths)])
155+
commands.extend([f"sys.path.insert(0, {str(path)!r})" for path in reversed(search_paths)])
156156

157157
if setup_commands := config.get("setup_commands"):
158158
# prevent the Python interpreter or the setup commands

0 commit comments

Comments
 (0)