Skip to content

gh-125313: Prefer sys.base_* paths in Py_Get(Exec)Prefix deprecation notes #125317

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
Oct 21, 2024

Conversation

y5c4l3
Copy link
Contributor

@y5c4l3 y5c4l3 commented Oct 11, 2024

@y5c4l3
Copy link
Contributor Author

y5c4l3 commented Oct 11, 2024

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

Can you please also update Doc/deprecations/c-api-pending-removal-in-3.15.rst ?

@y5c4l3
Copy link
Contributor Author

y5c4l3 commented Oct 11, 2024

Can you please also update Doc/deprecations/c-api-pending-removal-in-3.15.rst ?

Thanks for the reminder. I wasn't aware of the deprecation lists.

@@ -635,7 +635,8 @@ Process-wide parameters
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.

.. deprecated-removed:: 3.13 3.15
Get :data:`sys.prefix` instead.
Get :data:`sys.base_prefix` instead, or :data:`sys.prefix` if
:ref:`virtual environments <venv-def>` need to be handled.
Copy link
Member

@vstinner vstinner Oct 14, 2024

Choose a reason for hiding this comment

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

Can't we always advice to use sys.base_prefix instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is my concern. If someone looks up the stable API Py_GetPrefix and the docs bring them here, they are certainly aware of the deprecation, but probably unconscious that there are 2 alternatives with very subtle differences. Clarifying both would at least present the choices to developers depending on their needs. What's your opinion?

Copy link
Member

Choose a reason for hiding this comment

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

It makes sense.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@vstinner vstinner added the needs backport to 3.13 bugs and security fixes label Oct 21, 2024
@vstinner vstinner merged commit 7d88140 into python:main Oct 21, 2024
26 checks passed
@miss-islington-app
Copy link

Thanks @y5c4l3 for the PR, and @vstinner 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 Oct 21, 2024
…precation notes (pythonGH-125317)

Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` deprecation notes.

(cherry picked from commit 7d88140)

Co-authored-by: Y5 <[email protected]>
Signed-off-by: y5c4l3 <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Oct 21, 2024

GH-125776 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 Oct 21, 2024
@vstinner vstinner added the needs backport to 3.12 only security fixes label Oct 21, 2024
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

Sorry, @y5c4l3 and @vstinner, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 7d88140d5299bd086434840db66ede8ccd01a688 3.12

@vstinner vstinner removed the needs backport to 3.12 only security fixes label Oct 21, 2024
vstinner pushed a commit that referenced this pull request Oct 21, 2024
…eprecation notes (GH-125317) (#125776)

gh-125313: Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` deprecation notes (GH-125317)

Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` deprecation notes.

(cherry picked from commit 7d88140)

Signed-off-by: y5c4l3 <[email protected]>
Co-authored-by: Y5 <[email protected]>
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
…precation notes (python#125317)

Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` deprecation notes.

Signed-off-by: y5c4l3 <[email protected]>
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 news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants