fix(zipapp): guard against null runtime files (#4119) When building a zipapp archive with a Python runtime whose \`files\` attribute is \`None\` (such as a system interpreter), adding \`py_runtime.files\` to the runfiles builder raises an error. Only add \`py_runtime.files\` to the runfiles builder when it is not \`None\`. (cherry picked from commit 3da7faf4293499b6398a924583dc4a3beda1c4a3) Work towards #4121
diff --git a/CHANGELOG.md b/CHANGELOG.md index db92e87..5c4a774 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md
@@ -29,6 +29,17 @@ directory, or view the [latest generated changelog](https://rules-python.readthedocs.io/en/latest/changelog.html). +{#v2-3-3} +## [2.3.3] - 2026-09-02 + +[2.3.3]: https://github.com/bazel-contrib/rules_python/releases/tag/2.3.3 + +{#v2-3-3-fixed} +### Fixed +* (zipapp) Fixed handling of {obj}`PyRuntimeInfo` with `files = None` so creating + zipapp archives does not error. + + {#v2-3-2} ## [2.3.2] - 2026-08-22
diff --git a/python/private/zipapp/py_zipapp_rule.bzl b/python/private/zipapp/py_zipapp_rule.bzl index b1a9399..7e11b06 100644 --- a/python/private/zipapp/py_zipapp_rule.bzl +++ b/python/private/zipapp/py_zipapp_rule.bzl
@@ -133,7 +133,8 @@ runfiles = builders.RunfilesBuilder() - runfiles.add(py_runtime.files) + if py_runtime.files != None: + runfiles.add(py_runtime.files) if py_executable.venv_python_exe: runfiles.add(py_executable.venv_python_exe)