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

Make TracebackException work with Python 3.10. #2030

Closed

Conversation

nascheme
Copy link

@nascheme nascheme commented Jun 4, 2021

Pass '_seen' argument as None if empty (on first call). Pass 'compact'
kwarg as needed.

Pass '_seen' argument as None if empty (on first call). Pass 'compact'
kwarg as needed.
@nascheme
Copy link
Author

nascheme commented Jun 4, 2021

This might fix #1899.

@codecov
Copy link

codecov bot commented Jun 4, 2021

Codecov Report

Merging #2030 (5b33786) into master (2195763) will decrease coverage by 6.43%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##           master    #2030      +/-   ##
==========================================
- Coverage   99.56%   93.12%   -6.44%     
==========================================
  Files         114      114              
  Lines       14618    14584      -34     
  Branches     1117     1117              
==========================================
- Hits        14554    13582     -972     
- Misses         43      937     +894     
- Partials       21       65      +44     
Impacted Files Coverage Δ
trio/_core/_multierror.py 88.88% <60.00%> (-9.99%) ⬇️
trio/_windows_pipes.py 0.00% <0.00%> (-100.00%) ⬇️
trio/_wait_for_object.py 0.00% <0.00%> (-100.00%) ⬇️
trio/_core/_windows_cffi.py 0.00% <0.00%> (-100.00%) ⬇️
trio/_subprocess_platform/windows.py 0.00% <0.00%> (-100.00%) ⬇️
...tests/test_multierror_scripts/apport_excepthook.py 0.00% <0.00%> (-100.00%) ⬇️
trio/_core/_io_windows.py 0.00% <0.00%> (-98.77%) ⬇️
trio/tests/test_wait_for_object.py 10.37% <0.00%> (-89.63%) ⬇️
trio/_core/tests/test_windows.py 17.82% <0.00%> (-82.18%) ⬇️
trio/tests/test_windows_pipes.py 25.33% <0.00%> (-74.67%) ⬇️
... and 37 more

@altendky
Copy link
Member

Is this covered in #1921?

@nascheme
Copy link
Author

nascheme commented Jun 11, 2021

Is this covered in #1921?

I don't think so. It fixes the issue with the keyword argument. However there is a more subtle problem with Python 3.10. I believe the key commit is 6dfd1734f5b230bb8fbd2a9df806c1333b6652a8 in the cpython repo:
bpo-42848: remove recursion from TracebackException (GH-24158)

The meaning of _seen = None is now different than from _seen = set(). If you pass _seen=set(), the __init__ method will not correctly initialize the TracebackException object.

@altendky
Copy link
Member

I believe we have just implemented different means of passing None or set(), but that they are the same result?

https://github.com/altendky/trio/blob/c079d3cfdf4b91c76cd9aa376d1ddb76db4d40d7/trio/_core/_multierror.py#L405-L423

I tried a GitHub compare but it isn't showing what I expect.
altendky/trio@c079d3c...5b33786 So, here is a screenshot of my local diff. This PR on the left and #1921 on the right.

image

Aside from the _seen bit, it seems like the kwargs in this PR are unused.

@graingert
Copy link
Member

fixed in #1921 ?

@graingert graingert closed this Jul 22, 2021
@graingert graingert reopened this Jul 22, 2021
@graingert
Copy link
Member

ah no this is different

@Zac-HD
Copy link
Member

Zac-HD commented Oct 30, 2022

I think this has been fixed by the recent change to exceptiongroup, @agronholm can reopen if I'm wrong.

@Zac-HD Zac-HD closed this Oct 30, 2022
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.

4 participants