Skip to content

fix(system_python): Remove printing of not always present attribute#3781

Merged
aignas merged 5 commits into
bazel-contrib:mainfrom
limdor:fix_rules_python
May 20, 2026
Merged

fix(system_python): Remove printing of not always present attribute#3781
aignas merged 5 commits into
bazel-contrib:mainfrom
limdor:fix_rules_python

Conversation

@limdor
Copy link
Copy Markdown
Contributor

@limdor limdor commented May 16, 2026

This attribute is not part of the Python public API and in Debian 10 Buster (OpenJDK 11, gcc 8.3.0) it seems to not be defined.

This reverts one of the debug logging statements added in #3667

Fixes #3774

@limdor limdor requested review from aignas and rickeylev as code owners May 16, 2026 08:44
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request fixes an AttributeError on Debian 10 by removing a print_verbose call for sys._base_executable in the Python bootstrap template. Feedback was provided to correct a typo in the CHANGELOG.md file, changing the Debian 10 codename from "Booster" to "Buster".

Comment thread CHANGELOG.md Outdated
This attribute is not part of the Python public API and in  Debian 10
Buster (OpenJDK 11, gcc 8.3.0) it seems to not be defined.

This reverts one of the debug logging statements added in
bazel-contrib#3667

Fixes bazel-contrib#3774
print_verbose("VENV_REL_SITE_PACKAGES:", VENV_REL_SITE_PACKAGES)
print_verbose("WORKSPACE_NAME:", WORKSPACE_NAME )
print_verbose("bootstrap sys.executable:", sys.executable)
print_verbose("bootstrap sys._base_executable:", sys._base_executable)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Preferably it would be better to not remove but to use getattr for this.

Suggested change
print_verbose("bootstrap sys._base_executable:", sys._base_executable)
print_verbose("bootstrap sys._base_executable:", getattr(sys, "_base_executable", "unknown"))

Comment thread CHANGELOG.md
@aignas aignas enabled auto-merge May 20, 2026 08:30
@aignas aignas added this pull request to the merge queue May 20, 2026
Merged via the queue into bazel-contrib:main with commit c7efd79 May 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure in very basic example after upgrading from 1.9 to 2.0 on Debian 10 Buster

2 participants