Skip to content

Doc: Recommend shlex.quote alongside pipes removal #126570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

cjwatson
Copy link
Contributor

@cjwatson cjwatson commented Nov 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.


📚 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
Copy link
Contributor

@hauntsaninja hauntsaninja left a comment

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
48 checks passed
@miss-islington-app
Copy link

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
Copy link

bedevere-app bot commented Nov 14, 2024

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