Skip to content

Match Element.remove argument type diagnostics - #9068

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-element-remove-type-error
Oct 11, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-element-remove-type-error

Conversation

@youknowdot

@youknowdot youknowdot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Current revision

Targets main after #8950, with one logical commit: 39feb175a4f6d541055cad830ebfa8ab5e9aa8fd (parent d88c9350fb5de38b8c3be74ba8b53c8dd68a9b8f). The unique patch is byte-identical to the prior reviewed head and now includes main's merged #9082 shared CI fix; original author attribution and assistance trailers are retained. No files under Lib/ are changed.

Normal hooks, whitespace checks, and independent tree/history review passed. The temporary [skip ci] marker is removed and normal CI is enabled for this final head. No new local build or runtime test is claimed. Validation recorded below belongs to earlier revisions unless explicitly stated otherwise.

Rebased once after #9082 merged to repair the shared Python 3.15 IO reference failure. Normal commit hooks and exact range-diff/patch-equivalence checks pass. Exact-head hosted CI is running; no additional local runtime validation is claimed.

Summary

Extract the independent Element.remove argument diagnostic from #8954, adapted to the exact CPython 3.14 contract:

  • Report None specially and use the native type name for other invalid arguments.
  • Match the 50-byte type-name limit without splitting a UTF-8 character.
  • Preserve accepted Element subclasses, the identity/equality/reentrant removal loop, and the existing missing-child ValueError.

This does not include the adjacent 3.15 missing-child message change or any XML parser changes.

Sources: CPython 3.14.8 clinic wrapper, _PyArg_BadArgument, and UTF-8 precision handling. The relevant 3.14.7 contract is identical.

Validation

  • Independent source and final-diff review; normal commit hooks.
  • Focused six-case Python snippet passes CPython 3.14.7 and 3.14.8 and fails on the prior native baseline.
  • Native build and the six diagnostic cases passed; reference/native snippet harness: 2 pytest cases.
  • Four unchanged canonical accelerator removal/reentrancy tests passed. The direct unittest CLI hit the existing import-depth limit while loading asyncio through unittest.mock; preloading those dependencies allowed the same tests to run without changing the recursion limit or any assertion.
  • Stdlib and separate C-API Clippy checks with warnings denied.

No XML parser was constructed or executed by these focused tests. Full workspace suites and non-Linux runtime tests were not run locally. hosted CI is temporarily skipped.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: RustPython/RustPython/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b84f2ff2-a3fc-469f-a77f-244d5cc0d367

📥 Commits

Reviewing files that changed from the base of the PR and between d88c935 and 39feb17.


📒 Files selected for processing (2)
  • crates/stdlib/src/elementtree.rs
  • extra_tests/snippets/stdlib_xml.py

 _________________________________________________________________________
< Congratulations, you implemented a distributed single point of failure. >
 -------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stdlib_xml.py

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the six cases unchanged into stdlib_xml.py in de32170 and removed the separate snippet. The moved block is AST-identical and passes focused CPython 3.14.7/3.14.8 and native checks. Full XML snippet execution is not newly claimed.

@youknowdot
youknowdot force-pushed the fix-element-remove-type-error branch 2 times, most recently from 71e4bfa to ba210d6 Compare October 11, 2026 03:21
@youknowone
youknowone changed the base branch from main to stack/python-3.15-8950 October 11, 2026 03:25
@youknowdot
youknowdot force-pushed the fix-element-remove-type-error branch from ba210d6 to 63be507 Compare October 11, 2026 04:07
@youknowone
youknowone changed the base branch from stack/python-3.15-8950 to main October 11, 2026 04:09
@youknowdot
youknowdot force-pushed the fix-element-remove-type-error branch from 63be507 to 294f2f3 Compare October 11, 2026 04:14
@github-actions

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

The following Lib/ modules were modified. Here are their dependencies:

[ ] test: cpython/Lib/test/test_mmap.py (TODO: 19)

dependencies:

dependent tests: (2 tests)

  • mmap: test_os
    • multiprocessing.shared_memory: test_genericalias

Legend:

  • [+] path exists in CPython
  • [x] up-to-date, [ ] outdated

Match native type names, None spelling, and UTF-8 byte limits while preserving removal behavior. Keep all six regression cases in the existing XML snippet.

Assisted-by: OpenAI Codex:model identifier unavailable
@youknowdot
youknowdot force-pushed the fix-element-remove-type-error branch from 294f2f3 to 39feb17 Compare October 11, 2026 13:29
@codspeed

codspeed Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing youknowdot:fix-element-remove-type-error (39feb17) with main (d88c935)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@youknowone
youknowone marked this pull request as ready for review October 11, 2026 14:47
@youknowone
youknowone merged commit 1fa883b into RustPython:main Oct 11, 2026
21 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T14:51:59.017512Z 39feb17 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39feb175a4

ℹ️ 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".

]

root = Element("root")
for value, type_name in (

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove the newly added test logic

This hunk adds test data, control flow, and an assertion to extra_tests/snippets/stdlib_xml.py, but the repository's critical test-file policy permits only adding or removing expectedFailure decorators; this regression coverage therefore needs to be removed rather than extending the snippet.

AGENTS.md reference: AGENTS.md:L275-L279

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants