Repository navigation
Align bytes and bytearray operations with Python 3.15 - #9165
Conversation
Correct quote escaping, replacement count keyword binding, signed-minimum hex grouping, and clear storage/export handling. Migrate canonical bytes coverage through fail-closed preservation of the existing RustPython customizations, and retire only two freshly verified formatting guards. Assisted-by: OpenAI Codex:model version 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: 1
📒 Files selected for processing: 5
✨ 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 |
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: :4: SyntaxWarning: invalid decimal literal dependencies: dependent tests: (no tests depend on bytes) 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: 1e9e19bc8f
ℹ️ 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".
| self.assertEqual(three_bytes.hex(sep=':', bytes_per_sep=2), 'b9:01ef') | ||
| self.assertEqual(three_bytes.hex(sep='*', bytes_per_sep=-2), 'b901*ef') | ||
| for bytes_per_sep in 3, -3, 2**31-1, -(2**31-1): | ||
| for bytes_per_sep in 3, -3, sys.maxsize, -sys.maxsize: |
There was a problem hiding this comment.
Keep existing test bodies unchanged
This refresh changes the existing test data in test_hex_separator_basics, and the patch makes similar additions and edits to other test bodies, but the repository's critical test policy forbids modifying assertions, logic, or data and permits test-file edits only for expected-failure marker changes. Keep the canonical test bodies unchanged and restrict this change to the allowed marker edits and runtime implementation.
AGENTS.md reference: AGENTS.md:L276-L282
Useful? React with 👍 / 👎.
Summary
Extract the remaining bytes/bytearray compatibility fixes from #8954 onto current main:
countkeyword in bytes and bytearrayreplace().clear(), while preserving an empty exported buffer as a successful no-op.Refresh
test_bytes.pyfrom CPython 3.15.0 throughscripts/update_lib. The updater preserves the existing optional C-API import, three Vec-allocation assertion adaptations and their explanation comments, with fail-closed/idempotence tests. All other canonical test bodies remain unchanged. Retire only the two obsoletetest_modexpected-failure wrappers after both concrete inheritors passed fresh matching tests.The added block in the existing bytearray snippet covers only the exported-empty-clear gap; canonical repr, replacement, hex and allocation coverage is not duplicated.
Validation
test_bytes: 332 tests, 13 existing skips and 10 expected failures; no failures or unexpected successes.test_bytesoracle: 332 tests, 8 skips.cargo fmt --all -- --checkpassed.-D warnings) passed.The full snippets suite was not run locally because it includes AF_UNIX operations restricted in this environment. The focused snippet result is not a full-suite claim; hosted CI must complete the normal full suite for this exact head. No tests were changed to work around that environment restriction.
AI assistance
Implementation, canonical-source comparison, independent source review, and test execution were assisted by OpenAI Codex (model version unavailable).