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

Update tbutils.py to parse tracebacks with anchor lines #332

Merged
merged 2 commits into from
Apr 2, 2023

Conversation

sestinj
Copy link
Contributor

@sestinj sestinj commented Mar 30, 2023

Anchors are sometimes added below the source line, (see https://github.com/python/cpython/blob/dcd6f226d6596b25b6f4004058a67acabe012120/Lib/traceback.py#L479-L510). This fix will allow parsing to continue as normal in their presence

Anchors are sometimes added below the source line, (see https://github.com/python/cpython/blob/dcd6f226d6596b25b6f4004058a67acabe012120/Lib/traceback.py#L479-L510). This fix will allow parsing to continue as normal in their presence
@mahmoud
Copy link
Owner

mahmoud commented Mar 31, 2023

Ohhh very very nice, yes I was just running into something related today. Any chance we could get a test over here? https://github.com/mahmoud/boltons/blob/master/tests/test_tbutils_parsed_exc.py

Thanks for getting the ball rolling in either case!

@sestinj
Copy link
Contributor Author

sestinj commented Mar 31, 2023

Of course, here's a test! Added a note, but obviously without storing more information about columns in ParsedException (already noted here that some of this is missing), this will break the to_string(from_string(original_tb)) == original_tb property.

@mahmoud
Copy link
Owner

mahmoud commented Mar 31, 2023

Good point. I'm not opposed to adding more attributes, of course. Any interest in pursuing that in this PR, or should we make a separate issue?

@sestinj
Copy link
Contributor Author

sestinj commented Apr 2, 2023

It's unlikely I'll get to that soon, so wouldn't want to hold up this PR. I made a new issue here.

@mahmoud
Copy link
Owner

mahmoud commented Apr 2, 2023

Sounds good, thanks again for this!

@mahmoud mahmoud merged commit 4754628 into mahmoud:master Apr 2, 2023
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.

2 participants