-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Reported here: #120330 (comment)
class Foo:
def __iter__(self):
assert False
a = [x for x in Foo()]
output (Python 3.12.5):
Traceback (most recent call last):
File "/home/frank/projects/executing/codi.py", line 5, in <module>
a = [x for x in Foo()]
^^^^^^^^^^^^^^^^^^
File "/home/frank/projects/executing/codi.py", line 3, in __iter__
assert False
^^^^^
AssertionError
Linked PRs
- gh-123142: Fix too wide source locations in tracebacks of exceptions from broken iterables in comprehensions #123173
- [3.13] gh-123142: Fix too wide source locations in tracebacks of exceptions from broken iterables in comprehensions (GH-123173). #123209
- [3.12] gh-123142: Fix too wide source locations in tracebacks of exceptions from broken iterables in comprehensions (GH-123173). #123210
- gh-123142: fix too wide source location of GET_ITER/GET_AITER #123420
- [3.13] gh-123142: fix too wide source location of GET_ITER/GET_AITER (GH-123420). #123435
- [3.12] gh-123142: fix too wide source location of GET_ITER/GET_AITER (GH-123420). #123436
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error