Skip to content

Preserve Expat qualified names without namespace expansion - #9070

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-expat-raw-qualified-names
Oct 11, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-expat-raw-qualified-names

Conversation

@youknowdot

@youknowdot youknowdot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Current revision

Targets main after #8950, with one logical commit: d8a7620ae8b971a85f87d095d78ba95b6c5bba96 (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 raw-prefix branch from #8954's Expat name helper. When namespace_separator is omitted or None, preserve qualified element and attribute names such as p:x and p:a. Existing namespace-expanded names remain unchanged.

The four-line production change keeps the existing helper signature and all four call sites. It does not add namespace triplets, backend changes, namespace callbacks, or parser configuration changes.

Reference: CPython 3.14.8 ParserCreate contract, also present in 3.14.7.

Validation

  • Independent source, safety, and final-diff review; normal commit hooks.
  • Four bounded Python cases pass CPython 3.14.7 and 3.14.8: no namespace expansion/nonempty separator, each with dictionary/ordered attributes.
  • The previous native baseline fails the qualified-name assertion as expected.

The focused cases use one small in-memory ASCII document, fresh parsers, one final Parse call, and collecting handlers. No DTD, entity, file/network, unsupported triplet combination, or reentrant callback tests are involved.

Known backend differences in retaining root xmlns attributes and enforcing namespace bindings are outside this patch. The regression checks all element names and the complete child attribute container without claiming full non-namespace Expat parity.

Additional native validation passed: native build, all four focused cases, 2 reference/native pytest cases, and 5 unchanged canonical tests (namespace/ordered-attribute properties, legal/empty separator construction, and plain-name interning). Stdlib and separate C-API Clippy passed with warnings denied.

The broader canonical Expat suite was not run because it includes unrelated DTD/entity/lifecycle tests. Full workspace and non-Linux runtime validation 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: 9c7adeb4-a837-415b-9b5e-86ca3a8f280d

📥 Commits

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


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

 ____________________________________
< My Motto: Semper Bug Exterminatus. >
 ------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ 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_pyexpat.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.

Renamed it to stdlib_pyexpat.py in eaa8331. That filename did not already exist, so this is a 100% byte-identical rename; both reference/native snippet tests pass.

@youknowdot
youknowdot force-pushed the fix-expat-raw-qualified-names branch 2 times, most recently from 614deb3 to 7ac7f23 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-expat-raw-qualified-names branch from 7ac7f23 to 6ce36ee 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-expat-raw-qualified-names branch from 6ce36ee to 7f3638f 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

Retain raw element and attribute prefixes when namespace_separator is None. Keep expanded names and parser configuration unchanged, with regression coverage in the pyexpat snippet.

Assisted-by: OpenAI Codex:model identifier unavailable
@youknowdot
youknowdot force-pushed the fix-expat-raw-qualified-names branch from 7f3638f to d8a7620 Compare October 11, 2026 13:29
@youknowone
youknowone marked this pull request as ready for review October 11, 2026 14:48
@youknowone
youknowone merged commit 2ab8af3 into RustPython:main Oct 11, 2026
29 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:49.068179Z d8a7620 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.

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