Skip to content

Quote Explorer select paths with spaces#3445

Closed
rogierx wants to merge 1 commit into
pallets:mainfrom
rogierx:fix-launch-windows-locate-spaces
Closed

Quote Explorer select paths with spaces#3445
rogierx wants to merge 1 commit into
pallets:mainfrom
rogierx:fix-launch-windows-locate-spaces

Conversation

@rogierx
Copy link
Copy Markdown

@rogierx rogierx commented May 17, 2026

Summary

Fixes #2994 by quoting the Explorer /select, target on Windows when click.launch(..., locate=True) receives a path containing spaces.

The Windows shell parser treats /select,C:\path with spaces incorrectly, so Explorer falls back to opening a default folder. Passing /select,"C:\path with spaces" preserves the target path. Double quotes inside the path are escaped defensively before building the Explorer argument.

Validation

  • uv run --frozen pytest tests/test_termui.py::test_launch_windows_locate_quotes_path_with_spaces -q
  • uv run --frozen pytest tests/test_termui.py -q

@davidism davidism closed this May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

launch() cannot locate files with spaces in the name on Windows

2 participants