Bug description
Expected behavior:
Error messages should not repeat the same information.
Actual behavior:
resolver.py:286-288 wraps exceptions with raise ResolverException(f"...{original_msg}") from err — embedding the cause's text in the outer message AND chaining it as __cause__. When __main__._format_exception() formats this, it appends " because {cause}", producing a duplicated message:
Unable to resolve requirement specifier flashinfer-python==0.6.8.post1
with constraint flashinfer-python==0.6.11.post2: found no match for
flashinfer-python==0.6.8.post1 because found no match for
flashinfer-python==0.6.8.post1
The " because found no match..." portion is redundant — the same text already appears after the colon.
Steps to reproduce:
Trigger any resolution failure where find_all_matching_from_provider() wraps a ResolverException with from err (the common case for constraint conflicts or missing packages).
Proposed fix
Add a dedup check in _format_exception(): when the outer exception's message already starts with the cause's raw message (str(exc.__cause__)), skip the " because ..." clause. A startswith check matches the actual construction pattern (f"...{original_msg}") without false-positiving on coincidental substrings.
This was originally part of #1241 but is being split out as an independent fix.
Bug description
Expected behavior:
Error messages should not repeat the same information.
Actual behavior:
resolver.py:286-288wraps exceptions withraise ResolverException(f"...{original_msg}") from err— embedding the cause's text in the outer message AND chaining it as__cause__. When__main__._format_exception()formats this, it appends" because {cause}", producing a duplicated message:The
" because found no match..."portion is redundant — the same text already appears after the colon.Steps to reproduce:
Trigger any resolution failure where
find_all_matching_from_provider()wraps aResolverExceptionwithfrom err(the common case for constraint conflicts or missing packages).Proposed fix
Add a dedup check in
_format_exception(): when the outer exception's message already starts with the cause's raw message (str(exc.__cause__)), skip the" because ..."clause. Astartswithcheck matches the actual construction pattern (f"...{original_msg}") without false-positiving on coincidental substrings.This was originally part of #1241 but is being split out as an independent fix.