GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Document and fix command sanitizing with `shlex.split` by kdeldycke · Pull Request #3245 · pallets/click

Conversation

@kdeldycke

@kdeldycke kdeldycke commented Mar 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Also removes last use of shell=True use for command invokation for defense-in-depth.

Context

I was trying to eliminate the last usage of shell=True in subprocess.Popen, then had to resort to using shlex.split in edit_files. This led me into the rabbit hole of shlex.split usage in _termui_impl.py file. Which I use as an opportunity to document past choices from older issues and PRs.

Tests

I also use that opportunity to collect test cases discussed in older related issues and PRs to illustrate and cover how we are expecting command path to be unquoted and interpreted on POSIX systems and Windows.

Related

  • click.edit() Support Editor Paths Containing Spaces #1026
  • Use subprocess instead of os.system #1477
  • Improve echo_via_pager behaviour in face of errors #2775
  • 43a7d70

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kdeldycke kdeldycke added this to the 8.3.2 milestone Mar 5, 2026
@kdeldycke kdeldycke added bug prompt Interactive input and confirmation labels Mar 5, 2026
@Rowlando13 Rowlando13 modified the milestones: 8.3.2, 8.3.3 Mar 15, 2026
@kdeldycke
Document and fix command string sanitizing with shlex.split
b96c260
Removes last use of `shell=True` use for command invokation for defense-in-depth.
Refs: pallets#1026, pallets#1477 and pallets#2775
@kdeldycke
kdeldycke force-pushed the no-shell-command branch from b6b3178 to b96c260 Compare April 8, 2026 14:31
@Rowlando13
Rowlando13 merged commit 63ea71f into pallets:stable Apr 8, 2026
11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke
kdeldycke deleted the no-shell-command branch April 9, 2026 08:48
@kdeldycke

kdeldycke commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @Rowlando13 for the merge again ! 🎉

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kdeldycke added a commit to kdeldycke/click that referenced this pull request Apr 9, 2026
@kdeldycke
Add missing unreleased 8.3.3 section
1339fd3
Add missing entries for pallets#3238 and pallets#3299
Fix wrong version for pallets#3245 changelog entry
Lint section format
@kdeldycke

kdeldycke commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator Author

There was a tiny issue with the location of the changelog entry for that PR that I fixed in 1339fd3 and moved it to the 8.3.3 section.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

davidism
davidism reviewed Apr 9, 2026
View reviewed changes
Comment thread src/click/_termui_impl.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

davidism
davidism reviewed Apr 9, 2026
View reviewed changes
Comment thread src/click/_termui_impl.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

davidism
davidism reviewed Apr 9, 2026
View reviewed changes
Comment thread src/click/_termui_impl.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

davidism
davidism reviewed Apr 9, 2026
View reviewed changes
Comment thread src/click/_termui_impl.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

kdeldycke added a commit to kdeldycke/click that referenced this pull request Apr 10, 2026
@kdeldycke
Add path normalization edge-cases, verify shlex.split behavior
b552947
Also move to Python comments details relevant to developers instead of docstrings
Follow up to pallets#3245
@kdeldycke kdeldycke mentioned this pull request Apr 10, 2026
Path normalization documentation clean-up + shlex.split extensive tests #3330
Merged
@kdeldycke kdeldycke mentioned this pull request Apr 21, 2026
fix: _termui_impl.open_url() — 'start' on Windows is a cmd built-in, not an executable #3186
Merged
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@davidism davidism davidism left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

prompt Interactive input and confirmation

Projects

None yet

Milestone

8.3.3

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@kdeldycke @davidism @Rowlando13
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.