Skip to content

Doc: Recommend shlex.quote alongside pipes removal#126570

Merged
hauntsaninja merged 1 commit into
python:mainfrom
cjwatson:recommend-shlex-quote
Nov 14, 2024
Merged

Doc: Recommend shlex.quote alongside pipes removal#126570
hauntsaninja merged 1 commit into
python:mainfrom
cjwatson:recommend-shlex-quote

Conversation

@cjwatson

@cjwatson cjwatson commented Nov 8, 2024

Copy link
Copy Markdown
Contributor

One of the most common reasons I see the old pipes module still in use when porting to Python 3.13 is for the undocumented pipes.quote function, which can easily be replaced with shlex.quote. I think it's worth specifically calling this out, since being directed to the subprocess module would be confusing in this case.


📚 Documentation preview 📚: https://cpython-previews--126570.org.readthedocs.build/

One of the most common reasons I see the old `pipes` module still in use
when porting to Python 3.13 is for the undocumented `pipes.quote`
function, which can easily be replaced with `shlex.quote`.  I think it's
worth specifically calling this out, since being directed to the
`subprocess` module would be confusing in this case.
@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news awaiting review labels Nov 8, 2024
@ZeroIntensity ZeroIntensity added skip issue needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Nov 8, 2024

@hauntsaninja hauntsaninja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've seen this use of pipes a bunch too.

@hauntsaninja hauntsaninja removed the needs backport to 3.12 only security fixes label Nov 14, 2024
@hauntsaninja hauntsaninja enabled auto-merge (squash) November 14, 2024 05:01
@hauntsaninja hauntsaninja merged commit 73e34b6 into python:main Nov 14, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @cjwatson for the PR, and @hauntsaninja for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 14, 2024
One of the most common reasons I see the old `pipes` module still in use
when porting to Python 3.13 is for the undocumented `pipes.quote`
function, which can easily be replaced with `shlex.quote`.  I think it's
worth specifically calling this out, since being directed to the
`subprocess` module would be confusing in this case.
(cherry picked from commit 73e34b6)

Co-authored-by: Colin Watson <cjwatson@debian.org>
@bedevere-app

bedevere-app Bot commented Nov 14, 2024

Copy link
Copy Markdown

GH-126820 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Nov 14, 2024
hauntsaninja pushed a commit that referenced this pull request Nov 14, 2024
…#126820)

Doc: Recommend shlex.quote alongside pipes removal (GH-126570)

One of the most common reasons I see the old `pipes` module still in use
when porting to Python 3.13 is for the undocumented `pipes.quote`
function, which can easily be replaced with `shlex.quote`.  I think it's
worth specifically calling this out, since being directed to the
`subprocess` module would be confusing in this case.
(cherry picked from commit 73e34b6)

Co-authored-by: Colin Watson <cjwatson@debian.org>
picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
One of the most common reasons I see the old `pipes` module still in use
when porting to Python 3.13 is for the undocumented `pipes.quote`
function, which can easily be replaced with `shlex.quote`.  I think it's
worth specifically calling this out, since being directed to the
`subprocess` module would be confusing in this case.
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
One of the most common reasons I see the old `pipes` module still in use
when porting to Python 3.13 is for the undocumented `pipes.quote`
function, which can easily be replaced with `shlex.quote`.  I think it's
worth specifically calling this out, since being directed to the
`subprocess` module would be confusing in this case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants