-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: Use getattr for tcl/tk library paths #2945
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
Conversation
* Safely access tcl_lib and tk_lib attributes on the interpreter. * This prevents AttributeError if these attributes are not present. * Applied to nushell, bash, fish, and via_template activation scripts. Fixes pypa#2944 Signed-off-by: Emre Şafak <[email protected]>
@@ -15,8 +15,8 @@ def as_name(self, template): | |||
def replacements(self, creator, dest): | |||
data = super().replacements(creator, dest) | |||
data.update({ | |||
"__TCL_LIBRARY__": creator.interpreter.tcl_lib or "", | |||
"__TK_LIBRARY__": creator.interpreter.tk_lib or "", | |||
"__TCL_LIBRARY__": getattr(creator.interpreter, "tcl_lib", ""), |
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.
How come these can be not present?
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.
Not sure, I asked the reporter for the logs.
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 also don't understand why, but here is an example of a failing build: https://github.com/douwevandermeij/test-virtualenv/actions/runs/16797823289/job/47572059324
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.
Looks like a Poetry problem
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.
Looks like a Poetry problem
Open an issue there please 🤔 and link it to this.
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.
This does not look like a poetry problem, PythonInfo
is constructed and used only by virtualenv
code, it is hard for me to guess how this would be anything but a virtualenv problem.
I expect you have some path that fails to populate the new fields. Probably the stuff that gets it from cache.
Signed-off-by: Emre Şafak <[email protected]>
for more information, see https://pre-commit.ci
Signed-off-by: Emre Şafak <[email protected]>
Fixes #2944
tox -e fix
)docs/changelog
folder