SystemError: <method-wrapper '__init__' of ast.AST-child object at ...> returned NULL without setting an exception · Issue #117266 · python/cpython (original) (raw)

Bug report

Bug description:

import ast

class File(ast.AST): _fields = ("xxx",)

def __init__(self):
    super().__init__()

File()

Traceback (most recent call last):
  File ".../method_wrapper.py", line 11, in <module>
    File()
    ~~~~^^
  File ".../method_wrapper.py", line 8, in __init__
    super().__init__()
    ~~~~~~~~~~~~~~~~^^
SystemError: <method-wrapper '__init__' of File object at 0x7f923918cf10> returned NULL without setting an exception

This has happened since 3.13.0a5. Discovered via real usage in robotframework/robotframework#5091

CPython versions tested on:

3.13, CPython main branch

Operating systems tested on:

Linux

Linked PRs