Too wide location info for CHECK_EG_MATCH
Offen
Dieses Issue hat noch niemand übernommen.
interpreter-core
type-bug
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
The line number of the instructions emitted for except* (CHECK_EG_MATCH etc) spans the entire except* body, and this shows up in the traceback when except* raises (e.g. when split() fails).
>>> class Bad(ExceptionGroup):
... def split(*args):
... 1/0
...
>>> try: raise Bad("", [ValueError(), TypeError()])
... except* ValueError:
... 1
... 2
... 3
...
+ Exception Group Traceback (most recent call last):
| File "<python-input-1>", line 1, in <module>
| try: raise Bad("", [ValueError(), TypeError()])
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Bad: (2 sub-exceptions)
+-+---------------- 1 ----------------
| ValueError
+---------------- 2 ----------------
| TypeError
+------------------------------------
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<python-input-1>", line 2, in <module>
except* ValueError:
...<2 lines>...
3
File "<python-input-0>", line 3, in split
1/0
~^~
ZeroDivisionError: division by zero
Linked PRs
- gh-129026
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere den Traceback mit dem Beispiel except* und Bad.split() aus dem Issue und sieh dir anschließend den verlinkten PR gh-129026 an, um den Implementierungskontext zu verstehen. Fertig ist die Aufgabe, wenn die Position CHECK_EG_MATCH nicht mehr den gesamten except*-Block umfasst und der angezeigte Traceback weiterhin korrekt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- compilers
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 25/100