fix(files): preserve native Windows paths for ripgrep - #72922
Closed
lifeFedorovAlexey wants to merge 1 commit into
Closed
fix(files): preserve native Windows paths for ripgrep#72922lifeFedorovAlexey wants to merge 1 commit into
lifeFedorovAlexey wants to merge 1 commit into
Conversation
This was referenced Jul 27, 2026
Collaborator
Author
|
Confirmed — #63458 addresses the same three native ripgrep path arguments and already carries stronger call-site regression coverage. I am closing this PR as a duplicate rather than competing with the existing contribution. I also verified the approach against a real native-Windows Hermes environment: an absolute |
This was referenced Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes
search_fileswith absolute Windows paths when Hermes runs under Git Bash but invokes nativerg.exe.Hermes intentionally disables MSYS argv conversion. The existing generic shell escaping then rewrites
C:/Users/...to/c/Users/..., which reaches native ripgrep verbatim and fails with IO error 3. This PR preserves drive-letter paths only at the native-ripgrep boundary while leaving MSYS paths intact for shell builtins and fallback tools.Related Issue
Fixes #63177
Fixes #67629
Related: #72047
Type of Change
Changes Made
tools/file_operations.py: add native-CLI path escaping and use it for all three ripgrep path arguments.tests/tools/test_file_operations.py: cover nativeC:\\...and MSYS/c/...inputs while preserving existing shell escaping.How to Test
rg.exe, callsearch_fileswith an absoluteC:/Users/...path.C:/..., not/c/..., and returns matching files/content.env -u VIRTUAL_ENV uv run --no-project --python 3.12 --with pytest --with pytest-xdist python -m pytest tests/tools/test_file_operations.py -q -n 0 -k 'native_windows_cli_keeps_drive_paths_for_rg or escape_shell_arg_rewrites_windows_drive_paths_to_msys'Result:
2 passed.Checklist
Code
pytest tests/ -qand all tests pass (targeted affected tests were run; full upstream CI remains authoritative).Documentation & Housekeeping
cli-config.yaml.exampleupdate — N/A; no config keys changed.CONTRIBUTING.md/AGENTS.mdupdate — N/A; no architecture or workflow changed.Screenshots / Logs
Before:
After: the same absolute-path
search_filesrequest returns matches in the running Windows Hermes environment.