Bump PyO3 to 0.20 to fix backtraces (Cherry-pick of #20517) #20532
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.
Fixes #20460. Caused by PyO3/pyo3#3327.
Nothing in the changelog stands out to me as a super-immediate need so doing the minimal upgrade.
@ndellosa95 if you check this out branch run it as
MODE=debug ../path/to/repo/pants
, does it fix your cases too? I only tested a single rule in my case.Edit: It looks like this broke a single test, but the original nested chain seems odd to me -- where it previously showed just a "raise from" pointing at a yield (?) it now shows the full proper callstack. So now we have an extraneous "original error" at the top that ends at the rule edge. I think this is still an improvement over #20460, but if we can figure out where that original chained exception is added it'd be great.
EEdit: The reason it looks like this is that we throw when we handle the error on the Rust side. Unfortunately, at the point where we throw we can't tell whether we're in the middle of handling a raised error from Python or a new one. So the below reads:
Since this chaining doesn't seem to show up in most actual usage I'm opting to leave this as is/future work.