Skip to content
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

fix loss of context/cause on exceptions raised inside open_websocket #192

Merged
merged 8 commits into from
Nov 25, 2024

Conversation

jakkdl
Copy link
Member

@jakkdl jakkdl commented Oct 20, 2024

fixes #191

I'm not 100% sure that copy_exc is 100% robust (given that everything seems ever so fickle with copying exceptions), so it may be a good idea to wrap it in a try: except that gives up on copying if anything fails.

@jakkdl jakkdl requested a review from graingert October 23, 2024 10:32
@jakkdl
Copy link
Member Author

jakkdl commented Oct 23, 2024

shoutout to @graingert for the clean no-copy solution that avoids the issues mentioned in python-trio/flake8-async#298 and python/cpython#125782

trio_websocket/_impl.py Outdated Show resolved Hide resolved
@jakkdl jakkdl requested a review from graingert October 25, 2024 10:29
@jakkdl jakkdl requested a review from graingert November 7, 2024 12:11
@jakkdl jakkdl merged commit e7706f4 into python-trio:master Nov 25, 2024
9 checks passed
@jakkdl jakkdl deleted the exc_group_cause_context branch November 25, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

__cause__ and __context__ on user exceptions are lost when running with exception groups
3 participants