Fix winreg and Update test_launcher from v3.14.3#7155
Fix winreg and Update test_launcher from v3.14.3#7155youknowone merged 4 commits intoRustPython:mainfrom
Conversation
📝 WalkthroughWalkthroughRefactors winreg error handling: Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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 |
- SetValueEx: accept None for value_name (default registry value) - os_error_from_windows_code: use std::io::Error to properly set winerror attribute on OSError - EnumKey: use os_error_from_windows_code for proper error
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@crates/vm/src/stdlib/winreg.rs`:
- Around line 1058-1063: The RegSetValueExW call in the SetValueEx path
currently returns Err(vm.new_os_error(format!("error code: {res}"))) on nonzero
res; change this to use os_error_from_windows_code(vm, res as i32) so the
Windows error description is preserved (locate the Registry::RegSetValueExW
invocation and replace the vm.new_os_error path with
os_error_from_windows_code(vm, res as i32), matching the pattern used in
EnumKey, OpenKey, and SetValue).
🧹 Nitpick comments (1)
crates/vm/src/stdlib/winreg.rs (1)
297-297: Consider migrating remaining error sites toos_error_from_windows_codefor consistency.Several unchanged call sites (e.g.,
ConnectRegistry,CreateKey,CreateKeyEx,DeleteKey,FlushKey,LoadKey,CloseKey, etc.) still usevm.new_os_error(format!("error code: {res}")), which produces bare numeric error codes instead of human-readable Windows error messages. A follow-up pass to unify these would improve the user experience across all registry operations.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] test: cpython/Lib/test/test_launcher.py dependencies: dependent tests: (no tests depend on launcher) [x] lib: cpython/Lib/urllib dependencies:
dependent tests: (27 tests)
[x] test: cpython/Lib/test/test_winreg.py dependencies: dependent tests: (3 tests)
Legend:
|
Summary by CodeRabbit