fix: Use getattr for tcl/tk library paths#2945
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]>
| 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.
How come these can be not present?
There was a problem hiding this comment.
Not sure, I asked the reporter for the logs.
There was a problem hiding this comment.
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.
Looks like a Poetry problem
Open an issue there please 🤔 and link it to this.
There was a problem hiding this comment.
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.
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Fixes #2944
tox -e fix)docs/changelogfolder