`NameError` has different actions when be raised in IDLE
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Bug report
Bug description:
In IDLE, I raised three different exceptions. The output is:
>>>raise Exception("123\n456")
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
raise Exception("123\n456")
Exception: 123
456
>>>raise NameError("123\n456")
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
raise NameError("123\n456")
456
>>>raise OSError("123\n456")
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
raise OSError("123\n456")
OSError: 123
456
Only NameError cannot show the Exception Type if the text has two or more lines.
In shell the action is same with other exception.
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Linked PRs
- gh-135526
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
Beginne damit, die drei Ausnahmefälle in der IDLE-Shell unter Python 3.13 zu reproduzieren und sie mit der Ausgabe der normalen Shell zu vergleichen. Verfolge, wie IDLE mehrzeilige Ausnahmemeldungen formatiert, und überprüfe anschließend, dass bei einem mehrzeiligen NameError sein Ausnahmetyp konsistent mit Exception und OSError angezeigt wird; der verknüpfte PR gh-135526 zeigt, dass die Arbeit daran bereits im Gange ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- desktop
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 30/100