Skip to content

gh-133525: doc that PYTHONEXECUTABLE is not Mac-only and respected with -E/-I options - #133526

Closed
rickeylev wants to merge 6 commits into
python:mainfrom
rickeylev:docs.note.pyexe.envvar.exception
Closed

rickeylev wants to merge 6 commits into
python:mainfrom
rickeylev:docs.note.pyexe.envvar.exception

Conversation

@rickeylev

@rickeylev rickeylev commented May 6, 2025 •

Copy link
Copy Markdown
Contributor

This corrects the docs about how PYTHONEXECUTABLE is handled, specifically:

  • It is not Mac-specific. This was dropped in 3.11
  • The -I and -E options respect it.

Along the way:

  • Fix doc that PYTHONEXECUTABLE affects sys.executable, not sys.argv[0]

Fixes #133525


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

@python-cla-bot

python-cla-bot Bot commented May 6, 2025 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@StanFromIreland StanFromIreland 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.

Please fix the styling, it should be:

:envvar:`PYTHONEXECUTABLE`

and incline code should use double backticks i.e.

``-E``

@rickeylev

Copy link
Copy Markdown
Contributor Author

Thanks @StanFromIreland !

Done: Added the sphinx roles to the backtick'd symbols. Instead of double backticks for -E, -I, I added :option: to them.

PTAL

Comment thread Doc/using/cmdline.rst Outdated
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
@rickeylev

Copy link
Copy Markdown
Contributor Author

Oops, thanks for catching that. Suggestion applied.

Comment thread Doc/using/cmdline.rst Outdated
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 24, 2026
@ned-deily

Copy link
Copy Markdown
Member

Thank you for the PR and I apologize for the delay in reviewing it. But, as noted in my comment on the issue, I don't think these changes in PYTHONEXECUTABLE behavior were intended and, in any case, using it to try to implement a kind of relocatable venv seems undesirable to encourage. I still think we should just deprecate and remove it.

@ned-deily ned-deily closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review docs Documentation in the Doc dir skip news stale Stale PR or inactive for long period of time.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

PYTHONEXECUTABLE envvar incorrectly doc'd as mac-only and ignored by -E/-I

4 participants