Skip to content

Preserve requested encoding names in codec lookup errors - #9036

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-codec-lookup-error-name
Oct 10, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-codec-lookup-error-name

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Keep the requested encoding spelling in LookupError when codec lookup fails. Search hooks still receive the existing Python 3.14 normalized registry key.

Extracted from #8954 without its Python 3.15 normalization change. The existing codec snippet checks the diagnostic and search-hook names across the public lookup, encode, and decode entry points.

Validation:

  • CPython 3.14.7 passes the snippet. The pre-fix RustPython baseline exposes the normalized key in the error instead of the requested spelling.
  • Normal pre-commit hooks and VM Clippy pass.
  • Patched native runtime and aggregate tests await CI; local runtime linking is blocked by available disk space.

AI-assisted implementation, tests, and review with OpenAI Codex. Kept as a draft for CI and maintainer review.

Extract the Python 3.14-compatible lookup diagnostic fix from RustPython#8954 while retaining the existing registry normalization. Cover original error spelling and normalized search-hook names in the existing codec snippet.

Assisted-by: OpenAI Codex:model identifier unavailable
@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: 245ec30b-b044-4c32-a8e6-30a726976155

📥 Commits

Reviewing files that changed from the base of the PR and between 3af5f8a and 27a34d0.


📒 Files selected for processing (2)
  • crates/vm/src/codecs.rs
  • extra_tests/snippets/stdlib_codecs_wide.py

 ____________________________________________
< Rabbit in the repo, here to fix that bug 🎶 >
 --------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ 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.

@youknowone
youknowone marked this pull request as ready for review October 10, 2026 10:47
@youknowone
youknowone merged commit c516ca9 into RustPython:main Oct 10, 2026
30 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 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-10T10:50:36.089004Z 27a34d0 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