The Wayback Machine - https://web.archive.org/web/20250616092335/https://github.com/python/cpython/issues/99527
Skip to content

ValueError: incompatible stacks when jumping to async function signatures for python 3.11.0 #99527

Closed
@dkrystki

Description

@dkrystki

Jumping to async function signatures raises ValueError: incompatible stacks error.
Works for non async functions and python versions < 3.11

Environment:

  • CPython versions tested on: Python 3.11.0
  • Operating system and architecture: Linux q 5.4.0-42-generic x64

Full reproducer:

import asyncio
import sys


async def fun():  # <---- jump location
    a = 1

    b = 2

    c = 3  # current location


def trace(frame, event, arg):
    if event == "line" and frame.f_lineno == 10:
        frame.f_lineno = 5

    return trace

sys.settrace(trace)

if __name__ == "__main__":
    asyncio.run(fun())

What's the use case of it?
Reloadium keeps debug code in the function signature.
Above exception prevents reloadium to work on async functions.

Metadata

Metadata

Assignees

Labels

type-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions