Skip to content

MAINT: fix no-op str.replace() in editable path hook - #899

Merged
rgommers merged 1 commit into
mesonbuild:mainfrom
dnicolodi:fix/editable-path-hook
Sep 14, 2026
Merged

MAINT: fix no-op str.replace() in editable path hook#899
rgommers merged 1 commit into
mesonbuild:mainfrom
dnicolodi:fix/editable-path-hook

Conversation

@dnicolodi

Copy link
Copy Markdown
Member

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.

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 mesonbuild#868.
@dnicolodi
dnicolodi force-pushed the fix/editable-path-hook branch from a94e5e4 to 010c44b Compare September 13, 2026 17:06

@rgommers rgommers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @dnicolodi

@rgommers
rgommers merged commit 058b120 into mesonbuild:main Sep 14, 2026
35 checks passed
@rgommers rgommers added this to the v0.22.0 milestone Sep 14, 2026
@rgommers rgommers added the maintenance Regular code improvements that are not new features nor end-user-visible bugs label Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Regular code improvements that are not new features nor end-user-visible bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No-op str.replace in the editable path hook

2 participants