You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Further improve .python-version and runtime.txt error handling (#1962)
Some further improvements on-top of those made in #1958, based on build
error message scenarios seen in Honeycomb.
Now, if `.python-version` contains a single ESC control code (which gets
categorised as "very short file"), or contains any of the ASCI control
codes that result in the file being categorised as "data" (such as NUL),
then the "invalid python version" error message variant is shown instead
of the "invalid text encoding" variant.
In addition, any NULs in the file are substituted with a placeholder to
avoid this Bash warning:
```
/tmp/buildpack/lib/python_version.sh: line 104: warning: command substitution: ignored null byte in input
```
See:
https://manpages.ubuntu.com/manpages/noble/en/man1/file.1.htmlGUS-W-20220514.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@
3
3
## [Unreleased]
4
4
5
5
- Updated uv from 0.9.7 to 0.9.9. ([#1961](https://github.com/heroku/heroku-buildpack-python/pull/1961))
6
+
- Improved the error message shown for `.python-version` files that contain unexpected ASCII control code characters. ([#1962](https://github.com/heroku/heroku-buildpack-python/pull/1962))
7
+
- Fixed Bash command substitution warnings from being shown if `runtime.txt` contains null byte characters. ([#1962](https://github.com/heroku/heroku-buildpack-python/pull/1962))
0 commit comments