Handle unhandled uv errors prefixed with CPython interpreter info#14433
Merged
thavaahariharangit merged 4 commits intoMar 13, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves uv error handling in the Uv::FileUpdater::LockFileErrorHandler by converting previously-unhandled uv helper failures that include a Using CPython ... interpreter at: prefix into a standardized DependencyFileNotResolvable, and by stripping the interpreter prefix from surfaced messages.
Changes:
- Add a fallback handler that raises
DependencyFileNotResolvablewhen uv errors include theUsing CPythoninterpreter prefix. - Strip the
Using CPython ... interpreter at:line from cleaned error messages. - Add spec coverage for two “Using CPython”-prefixed unhandled error scenarios (conflicting URLs +
uv.lockparse failure).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
uv/lib/dependabot/uv/file_updater/lock_file_error_handler.rb |
Adds a CPython-prefixed fallback mapping to DependencyFileNotResolvable and strips the CPython prefix in message cleanup. |
uv/spec/dependabot/uv/file_updater/lock_file_error_handler_spec.rb |
Adds tests ensuring CPython-prefixed unhandled errors are converted to DependencyFileNotResolvable and the prefix is removed. |
Comments suppressed due to low confidence (1)
uv/lib/dependabot/uv/file_updater/lock_file_error_handler.rb:328
USING_CPYTHON_REGEXis introduced as a constant, butclean_error_messageuses a separate hard-coded regex to strip the CPython prefix. This duplication makes it easy for the match and the stripping behavior to drift. Consider reusing the constant (or redefining it to match the whole prefix line) in both places.
def clean_error_message(message)
message
.gsub(/Using CPython \S+ interpreter at: [^\n]+\n?/, "")
.gsub(/#{Regexp.escape(Utils::BUMP_TMP_DIR_PATH)}[^\s]*/o, "")
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
CPython interpreter info
markhallen
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
Catch unhandled
uverrors that start with UsingCPython <version> interpreter at:and surface them asDependencyFileNotResolvableinstead of letting them propagate as rawHelperSubprocessFailed/unknown_error.Anything you want to highlight for special attention from reviewers?
How will you know you've accomplished your goal?
lock_file_error_handler_spec.rbcovering both error scenarios —uvconflicting URLs resolution failure and uv.lock parse failure — both prefixed with Using CPython. Tests verify the correct exception type (DependencyFileNotResolvable) is raised and that the UsingCPython prefixis stripped from the error message.CPythonprefix should stop appearing and instead be recorded asdependency_file_not_resolvable, which is an expected/actionable error type.Checklist