-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
gh-125235: Keep _tkinter
TCL paths pointing to base installation on Windows
#125250
Conversation
y5c4l3
commented
Oct 10, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: win 10 Python-3.13.0 tkinter fails in venv #125235
Misc/NEWS.d/next/Library/2024-10-10-18-33-31.gh-issue-125235.0kOB5I.rst
Outdated
Show resolved
Hide resolved
@@ -143,7 +143,8 @@ _get_tcl_lib_path(void) | |||
struct stat stat_buf; | |||
int stat_return_value; | |||
|
|||
PyObject *prefix = PySys_GetObject("prefix"); // borrowed reference | |||
/* gh-125235: Should not use "prefix" which might point to venv root. */ | |||
PyObject *prefix = PySys_GetObject("base_prefix"); // borrowed reference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think removing //bordered reference
is more appropriate, because you have already explained it above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed my extra comment line, since it's neither a workaround nor a corner case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So deprecated Py_GetPath()
should be replaced with PySys_GetObject("base_prefix")
, instead of PySys_GetObject("prefix")
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So deprecated
Py_GetPath()
should be replaced withPySys_GetObject("base_prefix")
, instead ofPySys_GetObject("prefix")
?
Yeah, the equivalent of Py_GetPath
/ Py_GetPrefix
should be sys.base_prefix
, since sys.prefix
takes venv into consideration. I think it's necessary to clarify it in their deprecation notes: https://docs.python.org/3/c-api/init.html#c.Py_GetPrefix
Signed-off-by: y5c4l3 <[email protected]>
39ebf07
to
dbe4d9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ion on Windows (pythonGH-125250) (cherry picked from commit b3aa1b5) Co-authored-by: Y5 <[email protected]> Signed-off-by: y5c4l3 <[email protected]>
GH-125312 is a backport of this pull request to the 3.13 branch. |
Thank you for your bugfix @y5c4l3. I merged your PR. |
@y5c4l3: Do you want to propose a fix for the Py_GetPrefix() deprecation doc? |
…tion on Windows (GH-125250) (#125312) gh-125235: Keep `_tkinter` TCL paths pointing to base installation on Windows (GH-125250) (cherry picked from commit b3aa1b5) Signed-off-by: y5c4l3 <[email protected]> Co-authored-by: Y5 <[email protected]>