GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Bug in linecache when raising exceptiongroup that contains `ZeroDivisionError` + other exception. · Issue #101517 · python/cpython Closed Labels 3.11only security fixesonly security fixes3.12only security fixesonly security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportConsider this code: from asyncio import run, TaskGroup async def bad_function(): raise ZeroDivisionError async def bad_function2(): raise KeyError async def main(): try: async with TaskGroup() as tg: tg.create_task(bad_function()) tg.create_task(bad_function2()) except* ZeroDivisionError as e: breakpoint() run(main()) Run it on Python 3.11 or 3.12: --Return-- Traceback (most recent call last): File "....py", line 18, in <module> run(main()) File "/home/jonathan/.pyenv/versions/3.11.0/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/home/jonathan/.pyenv/versions/3.11.0/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jonathan/.pyenv/versions/3.11.0/lib/python3.11/asyncio/base_events.py", line 650, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File ".....py", line -1, in main File "/home/jonathan/.pyenv/versions/3.11.0/lib/python3.11/bdb.py", line 94, in trace_dispatch return self.dispatch_return(frame, arg) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jonathan/.pyenv/versions/3.11.0/lib/python3.11/bdb.py", line 153, in dispatch_return self.user_return(frame, arg) File "/home/jonathan/.pyenv/versions/3.11.0/lib/python3.11/pdb.py", line 372, in user_return self.interaction(frame, None) File "/home/jonathan/.pyenv/versions/3.11.0/lib/python3.11/pdb.py", line 434, in interaction self.print_stack_entry(self.stack[self.curindex]) File "/home/jonathan/.pyenv/versions/3.11.0/lib/python3.11/pdb.py", line 1554, in print_stack_entry self.format_stack_entry(frame_lineno, prompt_prefix)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jonathan/.pyenv/versions/3.11.0/lib/python3.11/bdb.py", line 573, in format_stack_entry line = linecache.getline(filename, lineno, frame.f_globals) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jonathan/.pyenv/versions/3.11.0/lib/python3.11/linecache.py", line 31, in getline if 1 <= lineno <= len(lines): TypeError: '<=' not supported between instances of 'int' and 'NoneType' One of the exceptions has to be a Your environment
Linked PRs
Activity
MetadataMetadataAssigneesLabels3.11only security fixesonly security fixes3.12only security fixesonly security fixestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |