| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Caution Review failedThe pull request is closed. WalkthroughThree Windows stdlib modules are enhanced with new API bindings: GetErrorMode() function added to msvcrt, three IO_REPARSE_TAG_* constants added to stat under Windows cfg, and winapi.rs receives updated GetStdHandle/DuplicateHandle signatures plus new ExitProcess function. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
📜 Recent review details Configuration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro 📥 CommitsReviewing files that changed from the base of the PR and between 0e0bd1e and a97c075. ⛔ Files ignored due to path filters (3)
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. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)crates/vm/src/stdlib/codecs.rs (2)📜 Review details239-316: Consider overflow check for large strings (optional).
The implementation correctly handles MBCS encoding with proper surrogate checking, two-pass buffer sizing, and strict error handling. However, the casts from wide.len() to i32 (lines 270, 291) could theoretically overflow for extremely large strings (> 2GB).
This is unlikely in practice and aligns with similar limitations in CPython's implementation.
436-513: Consider overflow check (optional); note code duplication.
The oem_encode implementation is nearly identical to mbcs_encode (differing only in using CP_OEMCP instead of CP_ACP). The same optional consideration applies regarding potential i32 overflow for extremely large strings.
Optional refactor: Consider extracting a common helper function to reduce duplication between mbcs_encode and oem_encode.
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📥 CommitsReviewing files that changed from the base of the PR and between 8781de6 and 0e0bd1e.
⛔ Files ignored due to path filters (3)📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.rs: Follow the default rustfmt code style by running cargo fmt to format Rust code
Always run clippy to lint Rust code (cargo clippy) before completing tasks and fix any warnings or lints introduced by changes
Follow Rust best practices for error handling and memory management
Use the macro system (pyclass, pymodule, pyfunction, etc.) when implementing Python functionality in Rust
Files:
Learnt from: moreal Repo: RustPython/RustPython PR: 5847 File: vm/src/stdlib/stat.rs:547-567 Timestamp: 2025-06-27T14:47:28.810Z Learning: In RustPython's stat module implementation, platform-specific constants like SF_SUPPORTED and SF_SYNTHETIC should be conditionally declared only for the platforms where they're available (e.g., macOS), following CPython's approach of optional declaration rather than providing fallback values for other platforms.
Learnt from: moreal Repo: RustPython/RustPython PR: 5847 File: vm/src/stdlib/stat.rs:547-567 Timestamp: 2025-06-27T14:47:28.810Z Learning: In RustPython's stat module implementation, platform-specific constants like SF_SUPPORTED and SF_SYNTHETIC should be conditionally declared only for the platforms where they're available (e.g., macOS), following CPython's approach of optional declaration using #ifdef checks rather than providing fallback values for other platforms.
crates/vm/src/stdlib/os.rs (1)crates/vm/src/stdlib/codecs.rs (1)
- errno_err (39-41)
crates/vm/src/stdlib/nt.rs (1)⏰ 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). (9)
- from_utf16 (327-329)
crates/vm/src/windows.rs (1)crates/vm/src/stdlib/winapi.rs (3)172-172: LGTM! Correct symlink file type handling.
The change properly clears existing file type bits using S_IFMT mask before setting the Windows-specific symlink type. This prevents invalid combined file type bits that could result from OR-ing with the previous mode.
88-102: LGTM! Proper handle error and null handling.
The refactored GetStdHandle correctly distinguishes between:
- INVALID_HANDLE_VALUE → returns error via errno_err(vm)
- NULL handle → returns None (e.g., detached console)
- Valid handle → returns Some(HANDLE)
This pattern aligns with Rust idioms and provides proper error propagation to Python.
127-128: LGTM! Improved API ergonomics.
Splitting the source handle into two separate parameters (src_process and src) instead of a tuple makes the API more intuitive and idiomatic.
308-311: LGTM! ExitProcess added for process termination.
The function exposes Windows' ExitProcess API, which terminates the process immediately without running destructors or cleanup handlers. This is analogous to Python's os._exit() and is appropriate for the low-level _winapi module.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary by CodeRabbit
Release Notes
New Features
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.