-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
open_tcp_listeners exception __cause__ is always an ExceptionGroup #2900
open_tcp_listeners exception __cause__ is always an ExceptionGroup #2900
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2900 +/- ##
==========================================
+ Coverage 99.65% 99.67% +0.01%
==========================================
Files 115 115
Lines 17310 17308 -2
Branches 3110 3109 -1
==========================================
+ Hits 17251 17252 +1
+ Misses 40 38 -2
+ Partials 19 18 -1
|
From what I understand from what you have said in your comment above, the way exceptions are handled for |
Yeah that's correct. But the current behaviour having been in place for two years with nobody complaining means that it's not especially confusing or anything, and changing the behaviour might break code that's working perfectly fine at the moment - which I think is a very good reason not to change it. Also, re: "rest of trio" - I'm pretty sure it's only Nurseries that raise exceptiongroups and respect |
I don't think we should have a parameter for As for breaking compatibility, that makes sense, so I also agree there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the comments above that keeping the current behavior and just fixing this test is the best way forward at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Not sure what type of review this is, Github's UI seems to have a bug at the moment.
I suspect it's because the PR was already merged when you did the review. |
2 years ago, 4bd09bc changed
open_tcp_listeners
to useExceptionGroup
instead ofMultiError
for the__cause__
, which led to a behavior change in single-fail cases whereMultiError
s would collapse into the contained exception - something thatExceptionGroup
doesn't do.I only noticed this due to some confusion on my part when interpreting codecov in #2822.
I suspect we want to stick with the current behavior and just fix the test, but splitting it out so it can be discussed.
Current
open_tcp_listeners
trio/src/trio/_highlevel_open_tcp_listeners.py
Lines 166 to 173 in 60b9e14
and the test
trio/src/trio/_tests/test_highlevel_open_tcp_listeners.py
Lines 326 to 335 in 60b9e14