Skip to content

fix: handle spaces in paths for launch(locate=True) on Windows#3341

Closed
Herrtian wants to merge 1 commit into
pallets:mainfrom
Herrtian:fix/launch-spaces-windows
Closed

fix: handle spaces in paths for launch(locate=True) on Windows#3341
Herrtian wants to merge 1 commit into
pallets:mainfrom
Herrtian:fix/launch-spaces-windows

Conversation

@Herrtian

@Herrtian Herrtian commented Apr 15, 2026

Copy link
Copy Markdown

Fixes #2994

On Windows, launch(path, locate=True) passes the explorer command as a list:

args = ["explorer", f"/select,{url}"]

subprocess.call joins list args with spaces, so a path like C:\my folder\file.txt gets split at the space and explorer opens the wrong location.

Changed to pass a single string with the path quoted so it works with spaces.

explorer /select,<path> was passed as a list to subprocess.call(),
which caused Windows to split the path at spaces. Changed to pass
a single command string with the path quoted so explorer receives
the full path correctly.

Fixes #2994
@kdeldycke

Copy link
Copy Markdown
Collaborator

AI slop

@kdeldycke kdeldycke closed this Apr 15, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 30, 2026
@kdeldycke kdeldycke added this to the 8.4.1 milestone May 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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