Skip to content

Comments

Fix explorer /select with spaces on Windows (#2994)#3216

Closed
SamrudhNR wants to merge 6 commits intopallets:mainfrom
SamrudhNR:fix/2994-launch-spaces
Closed

Fix explorer /select with spaces on Windows (#2994)#3216
SamrudhNR wants to merge 6 commits intopallets:mainfrom
SamrudhNR:fix/2994-launch-spaces

Conversation

@SamrudhNR
Copy link

Fix explorer /select with spaces on Windows

Closes #2994

Problem
On Windows, click.launch(path, locate=True) fails to select files or folders when the path contains spaces. Explorer opens the user's Documents folder instead of selecting the target.

Cause
When passing arguments as a list to subprocess.call, list2cmdline wraps the entire /select,<path> part in outer quotes. This confuses explorer.exe's parser, causing it to ignore the path.

Fix
Build the command as a single string with quotes placed only around the path:

cmd = f'explorer /select,"{url}"'
subprocess.call(cmd)

samrudh and others added 6 commits February 19, 2026 14:11
@davidism davidism closed this Feb 19, 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