| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Hi @Carreau, just updated the branch with the latest main; checks are passing. Wanted to bump this since it's been open for a bit. Please take a look when you get a chance, and let me know if anything needs changing before it can be merged. Thanks! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #14961
This PR standardises filename handling by moving quoting responsibility into the editor hook.
Problem
%edit single-quoted the target filename before passing it to self.shell.hooks.editor() if the path contained spaces. The default editor hook (IPython/core/hooks.py) then built a shell command by string-formatting editor, linemark, and filename together, without quoting filename at all — relying on %edit having already done it. Custom hooks installed via IPython/lib/editorhooks.py also call shlex.quote(filename) on their own, assuming a raw filename — so any path with spaces reaching those hooks got double-quoted and broken (e.g. the Notepad++ hook).
In short, callers and hooks disagreed about who owns quoting, and only one side actually did it.
Fix
Established a clear contract: hooks.editor() always receives a raw, unquoted filename. Quoting/escaping for shell execution is the responsibility of the hook implementation.
Tests
Compatibility note
This changes the editor hook contract so that hooks.editor() now receives a raw filename instead of a pre-quoted one.
Manual verification
Verified %edit on a path containing spaces opens correctly via the default hook and via a custom hook (Notepad++), with no stray quote characters and no "file not found" errors.