gh-76303: Improve -x option documentation#144857
Open
RoryGlenn wants to merge 5 commits intopython:mainfrom
Open
gh-76303: Improve -x option documentation#144857RoryGlenn wants to merge 5 commits intopython:mainfrom
RoryGlenn wants to merge 5 commits intopython:mainfrom
Conversation
Expand the documentation for the -x command-line option to explain its purpose and usage for turning Python scripts into Windows batch files, with examples of batch file header lines. Closes python#76303.
Misc/NEWS.d/next/Documentation/2026-02-16-00-01-09.gh-issue-76303.h51xeQ.rst
Show resolved
Hide resolved
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
serhiy-storchaka
approved these changes
Feb 25, 2026
Member
serhiy-storchaka
left a comment
There was a problem hiding this comment.
LGTM, but it needs a review from Windows experts. Right now it is difficult to me to test this on Windows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Expand the documentation for the
-xcommand-line option to explain its purpose and usage for turning Python scripts into Windows batch files, with examples of batch file header lines.The current documentation is a single line:
This gives virtually no information about why the option exists or how to use it. As noted by @serhiy-storchaka in the issue, the purpose of
-xis to allow turning Python scripts into Windows batch files (similar to how shebang lines work on Unix).The expanded documentation now includes:
-xis needed (the header line is not valid Python syntax)📚 Documentation preview 📚: https://cpython-previews--144857.org.readthedocs.build/