-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix stdio encoding #6617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix stdio encoding #6617
Conversation
📝 WalkthroughWalkthroughThis pull request adds support for the PYTHONIOENCODING environment variable, enabling customization of standard input/output stream encoding and error handling. Changes include environment variable parsing, new settings fields, VM initialization updates for ASCII and UTF-8 encoding registration, and corresponding module aliasing. Changes
Sequence DiagramsequenceDiagram
participant User as User/Environment
participant Parser as Settings Parser
participant Settings as Settings Struct
participant VM as VM Initialization
participant Encodings as Encoding Registry
participant Stdio as TextIOWrapper
User->>Parser: PYTHONIOENCODING=utf-8:strict
Parser->>Settings: Parse & populate stdio_encoding, stdio_errors
Settings->>VM: Initialize with Settings
VM->>Encodings: import_ascii_utf8_encodings()
Encodings->>Encodings: Register ASCII codec (encodings_ascii)
Encodings->>Encodings: Register UTF-8 codec (encodings_utf_8)
VM->>Stdio: Create stdin/stdout TextIOWrapper
Stdio->>Stdio: Apply stdio_encoding & stdio_errors from Settings
VM->>Stdio: Create stderr TextIOWrapper
Stdio->>Stdio: Use hardcoded backslashreplace error handling
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
🧰 Additional context used📓 Path-based instructions (2)**/*.rs📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.py📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🪛 Flake8 (7.3.0)crates/vm/Lib/core_modules/encodings_ascii.py[error] FileNotFoundError: [Errno 2] No such file or directory: 'crates/vm/Lib/core_modules/encodings_ascii.py' (E902) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (8)
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 |
df0c30c to
e3517a0
Compare
e3517a0 to
8cd06c2
Compare
related to #6428
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.