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
Use raise from
when raising new IncompleteRead
#73139
Comments
I had this error come up in my code, and because it doesn't use |
I just pushed a new feature which may provide a simpler way to do this: https://bugs.python.org/issue45607 |
Interesting feature Irit, thank you Two things:
|
It’s meant for thing you want to add to the msg after the exception was created. The PR here seems to create a new exception of the same type in order to chain it with an additional msg. I’m suggesting that it might be sufficient to attach a note to the existing exception instead. |
This might work here, but you'd need to be sure there isn't any important code that looks at the IncompleteRead exception and expects the data to be in its message. Also I hope that various tools like IDEs would learn quickly that they need to display the note in their traceback views, otherwise all of these notes would be hidden from many people. |
Exception message text is not part of the api. The type is. |
Okay, works for me. |
raise from
when raising new IncompleteRead #29861Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: