Skip to content

gh-69753: shlex: Support parsing byte streams for posix=False or whitespace_split=True - #163139

Open
hramrach wants to merge 12 commits into
python:mainfrom
hramrach:main
Open

hramrach wants to merge 12 commits into
python:mainfrom
hramrach:main

Conversation

@hramrach

@hramrach hramrach commented Dec 4, 2026 •

Copy link
Copy Markdown

Removes the annoying limitation that byte arrays are not supported by shlex.

Unlike python shlex actual shells use byte arrays, not python strings.

@python-cla-bot

python-cla-bot Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

bedevere-app Bot commented Dec 4, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@hramrach hramrach changed the title shlex: Support parsing byte streams for posix=False or whitespace_split=True gh-69753: shlex: Support parsing byte streams for posix=False or whitespace_split=True Dec 4, 2026
@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Dec 4, 2026
for posix=False or whitespace_split=True

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The NEWS entry is too aggressive, there shpuld be a What's New, and updated versionchanged directives in the shlex.rst file. Overall we are also lacking tests and there are multiple changes made in a single PR. I do not think this is accpetable and I would rather see this as multiple PRs.

However the issue discussion is still stalled and all PRs werr closed. I believe there should be no PR until we reach a consensus as core devs.

Comment thread Lib/shlex.py Resolved
Comment thread Lib/shlex.py Resolved
Comment thread Lib/shlex.py Resolved
Comment thread Lib/shlex.py Resolved
Comment thread Lib/shlex.py Resolved
Comment thread Lib/shlex.py
infile = self.infile
if lineno is None:
lineno = self.lineno
return "\"%s\", line %d: " % (infile, lineno)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I do not think we should support infile bytes. This will no longer be emacs compliant I think

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Infile can be read from the input stream.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

If the change in output is the problem it can be formatted differently to provide identical output.

Comment thread Lib/shlex.py Resolved
Comment thread Lib/shlex.py Resolved
@bedevere-app

bedevere-app Bot commented Dec 4, 2026

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

hramrach and others added 4 commits December 4, 2026 17:19
@read-the-docs-community

read-the-docs-community Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

📖 2 files modified


Preview · build overview · cpython-previews · built Dec. 4, 2026, 6:39 p.m. UTC

Comment thread Lib/shlex.py Resolved
Comment thread Lib/shlex.py Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants