From 010c44bf21e7e3c4403395b719079c1a043269bb Mon Sep 17 00:00:00 2001 From: Daniele Nicolodi Date: Sun, 13 Sep 2026 18:52:01 +0200 Subject: [PATCH] MAINT: fix no-op str.replace() in editable path hook To the best of my knowledge, this is inconsequential. The path passed to the path hook is used only to check whether it is handled by the editable wheel import hook. The only paths that match this criteria come from the __path__ attribute of a module loaded via the editable package import hook and these are computed with the correct path separator. However, it is hard to rule out anyone doing something funny with these paths, thus be on the safe side and normalize the path separators. Fixes #868. --- mesonpy/_editable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonpy/_editable.py b/mesonpy/_editable.py index f11b48af2..87d80f400 100644 --- a/mesonpy/_editable.py +++ b/mesonpy/_editable.py @@ -391,7 +391,7 @@ def _rebuild(self) -> Node: def _path_hook(self, path: str) -> MesonpyPathFinder: if os.altsep: - path.replace(os.altsep, os.sep) + path = path.replace(os.altsep, os.sep) path, _, key = path.rpartition(os.sep) if path == __file__: tree = self._rebuild()