Repository navigation
Implement Python 3.15 base64 APIs - #9085
Conversation
Follow CPython 3.15.0 final d220409a13b77de7a6c30abe16ea90db01528edc for base64 options, alphabets, padding and canonical decoding. Keep reverse-table caches in traced module-native state and preserve module-bound callable semantics. Add bounded Python regressions without editing Lib. Assisted-by: OpenAI Codex:model identifier unavailable
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters (2)
📒 Files selected for processing (7)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
rather than adding this test, update Lib/test/test_binascii.py to 3.15
Migrate Lib/test/test_binascii.py unchanged from CPython 3.15.0 final using scripts/update_lib and replace the superseded custom base64 snippet. Implement the base32, Base85, Ascii85 and hex ignorechars APIs required by the canonical suite. Share the existing module-bound original-key alphabet cache across base32/base64/base85 and preserve argument and buffer cleanup semantics. Keep the existing base64 kernels and VM state integration unchanged. Assisted-by: OpenAI Codex:model identifier unavailable
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] test: cpython/Lib/test/test_binascii.py dependencies: dependent tests: (95 tests)
Legend:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d459d2b2d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| def test_base64_bad_padding(self): | ||
| # Test malformed padding | ||
| def _assertRegexTemplate(assert_regex, data, | ||
| non_strict_mode_expected_result, **kwargs): | ||
| data = self.type2test(data) |
There was a problem hiding this comment.
Restore the existing binascii test logic
This replacement rewrites the pre-existing strict-mode test, including its helper behavior and test data, rather than merely marking an unsupported case. Repository policy forbids modifying test assertions, logic, or data, so restore the existing canonical test and keep new behavior coverage outside this file.
AGENTS.md reference: AGENTS.md:L275-L275
Useful? React with 👍 / 👎.
Summary
Implement the cohesive base64 encoder/decoder API from CPython 3.15.0 final.
padded,wrapcol, andalphabetoptions, including whole-quantum wrapping and arbitrary 64-byte alphabets.padded,alphabet,ignorechars, andcanonicaloptions, with strictness defaulting according to whetherignorecharswas supplied.Lib/files are modified.This is the Rust-stage base64 prerequisite for #9079. Other 3.15 codec API additions remain separate work.
Validation
Base:
a10744303f6fb113a6082dde133958ad882d25a4.Head:
2505ad5f95831e62c821aef1ed14054655e9dc46.-D warnings; normal commit hooks and whitespace checks passed.Lib/byte-for-byte: 48/48 for the snippet and 92/92 for the canonical runner.binasciiitself was the verified native module.Full local workspace/C-API suites, broad canonical modules, SSL integration and non-Linux runtime validation were not run for this head. Hosted CI must establish the remaining matrix. Keep this PR draft and unmerged pending that validation and maintainer review.
AI assistance
OpenAI Codex implemented, reviewed and validated this change under maintainer direction. The exact model identifier is unavailable in this environment; the commit includes an
Assisted-bytrailer. This draft does not claim completed human validation.