Repository navigation
Conversation
🧪 Hands-on test: No problems observed in 6 scenariosCommit Scenarios
Runner's notes in full
🤖 Automated hands-on test — not a review approval · model claude-opus-5.5 · Kiro kiro-cli 2.33.1 · build History (3)
|
reedham-aws
left a comment
There was a problem hiding this comment.
Seems like the unit tests are failing, I think you'll need to check that.
- decode(): Python 3.15 enables UTF-8 mode by default (PEP 686), so locale.getpreferredencoding() returns "utf-8" even when the locale (and the output of external tools such as pip, npm and maven) uses another encoding. Prefer locale.getencoding() (3.11+), falling back to getpreferredencoding(). Fixes TestDecode::test_does_not_crash_non_utf8_encoding on Windows/3.15. - _is_within_directory(): use os.path.commonpath instead of the character-based (and, on 3.15, deprecated) os.path.commonprefix, which treated sibling paths sharing a name prefix (e.g. /tmp/ab/x vs /tmp/a) as being inside the directory.
There was a problem hiding this comment.
🧪 Hands-on test reproduced 2 new problems on commit 1798900. Commands and evidence are in the hands-on comment.
- [REGRESSION] decode() now uses locale.getencoding(), so UTF-8 tool output becomes U+FFFD replacement characters under a C/POSIX locale · medium · aws_lambda_builders/utils.py:255
- [REGRESSION] dotnet OSUtils.unzip creates broken symlinks for non-ASCII targets under LC_ALL=C (target decoded via the new decode() encoding) · low · aws_lambda_builders/workflows/dotnet_clipackage/utils.py:100
🤖 Automated hands-on test — not a review approval
| UTF-8 mode. | ||
| """ | ||
| getencoding = getattr(locale, "getencoding", None) | ||
| return getencoding() if getencoding else locale.getpreferredencoding() |
There was a problem hiding this comment.
🧪 Hands-on: [REGRESSION] decode() now uses locale.getencoding(), so UTF-8 tool output becomes U+FFFD replacement characters under a C/POSIX locale (reproduced 2 times in S5). Commands and evidence: hands-on comment.
…-8 mode locale.getencoding() returns ASCII for the C/POSIX locale, where Python already enables UTF-8 mode automatically (PEP 540), and ignores an explicit PYTHONUTF8=1 / -X utf8. Using it unconditionally turned UTF-8 tool output into U+FFFD in those environments (regression from the previous commit). _locale_encoding() now: - returns utf-8 when UTF-8 mode is explicitly requested - otherwise returns the locale encoding, except ASCII (or unknown) locale encodings, which are decoded as utf-8 (a superset of ASCII) - keeps locale.getpreferredencoding() on Python < 3.11 This matches the pre-3.15 behaviour in all these cases, while still decoding non-UTF-8 locale output (e.g. Windows ANSI code pages) correctly on 3.15.
Regression test for OSUtils.unzip decoding UTF-8 symlink targets when the locale encoding is ASCII (C/POSIX). Fixed by the previous commit.
reedham-aws
left a comment
There was a problem hiding this comment.
I think the changes you made are alright, but I'd rather keep this PR separate to just adding the Python 3.15 runtime. Do you think you could split some of the decoding changes out and just have a test fix in this one to make the CI pass?
| # commonpath compares whole path components; commonprefix compares characters, | ||
| # which would wrongly treat "/tmp/ab/x" as being inside "/tmp/a". |
There was a problem hiding this comment.
I think we don't need this comment especially because we don't use commonprefix anymore, so it's essentially referencing nothing.
It's fine, not worth another round of review
Issue #, if available:
Description of changes
feat: Add python3.15 runtime support.
Description of how you validated changes
Running manual testing locally
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.