-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Deprecation of Py_GetPrefix
-family APIs should document the sys.base_*
counterparts
#125313
Labels
docs
Documentation in the Doc dir
Comments
A fuller comparison for reference: >>> import poc
... import sys
... for attr in ['executable', 'path', 'prefix', 'base_prefix', 'exec_prefix', 'base_exec_prefix']: print(f'sys.{attr}:', getattr(sys, attr))
...
Py_GetProgramName: python
Py_GetProgramFullPath: /home/y5/micromamba/envs/py3.13/bin/python
Py_GetPath: /home/y5/micromamba/envs/py3.13/lib/python313.zip:/home/y5/micromamba/envs/py3.13/lib/python3.13:/home/y5/micromamba/envs/py3.13/lib/python3.13/lib-dynload
Py_GetPrefix: /home/y5/micromamba/envs/py3.13
Py_GetExecPrefix: /home/y5/micromamba/envs/py3.13
sys.executable: /home/y5/micromamba/envs/py3.13/bin/python
sys.path: ['', '/home/y5/micromamba/envs/py3.13/lib/python313.zip', '/home/y5/micromamba/envs/py3.13/lib/python3.13', '/home/y5/micromamba/envs/py3.13/lib/python3.13/lib-dynload', '/home/y5/micromamba/envs/py3.13/lib/python3.13/site-packages']
sys.prefix: /home/y5/micromamba/envs/py3.13
sys.base_prefix: /home/y5/micromamba/envs/py3.13
sys.exec_prefix: /home/y5/micromamba/envs/py3.13
sys.base_exec_prefix: /home/y5/micromamba/envs/py3.13 # inside venv
>>> import poc
... import sys
... for attr in ['executable', 'path', 'prefix', 'base_prefix', 'exec_prefix', 'base_exec_prefix']: print(f'sys.{attr}:', getattr(sys, attr))
...
Py_GetProgramName: python
Py_GetProgramFullPath: /tmp/foo/bin/python
Py_GetPath: /home/y5/micromamba/envs/py3.13/lib/python313.zip:/home/y5/micromamba/envs/py3.13/lib/python3.13:/home/y5/micromamba/envs/py3.13/lib/python3.13/lib-dynload
Py_GetPrefix: /home/y5/micromamba/envs/py3.13
Py_GetExecPrefix: /home/y5/micromamba/envs/py3.13
sys.executable: /tmp/foo/bin/python
sys.path: ['', '/home/y5/micromamba/envs/py3.13/lib/python313.zip', '/home/y5/micromamba/envs/py3.13/lib/python3.13', '/home/y5/micromamba/envs/py3.13/lib/python3.13/lib-dynload', '/tmp/foo/lib/python3.13/site-packages']
sys.prefix: /tmp/foo
sys.base_prefix: /home/y5/micromamba/envs/py3.13
sys.exec_prefix: /tmp/foo
sys.base_exec_prefix: /home/y5/micromamba/envs/py3.13 |
vstinner
pushed a commit
that referenced
this issue
Oct 21, 2024
…ion notes (#125317) Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` deprecation notes. Signed-off-by: y5c4l3 <y5c4l3@proton.me>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
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 <124019959+y5c4l3@users.noreply.github.com> Signed-off-by: y5c4l3 <y5c4l3@proton.me>
Fixed by change 7d88140. |
vstinner
pushed a commit
that referenced
this issue
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 <y5c4l3@proton.me> Co-authored-by: Y5 <124019959+y5c4l3@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Documentation
Documentation suggests
sys.prefix
as an alternative toPy_GetPrefix
in the deprecation note hereand it seems correct:
But strictly speaking,
sys.base_prefix
is the real counterpart rather thansys.prefix
when it involves venv:Source: #125235
Linked PRs
sys.base_*
paths inPy_Get(Exec)Prefix
deprecation notes #125317sys.base_*
paths inPy_Get(Exec)Prefix
deprecation notes (GH-125317) #125776The text was updated successfully, but these errors were encountered: