Closed
Description
Test extracted from Cython tests/run/methodmangling_T5.py
:
class CMultiplyNested:
def f1(self):
__arg = 1
class D:
def g(self, __arg):
return __arg
return D().g(_CMultiplyNested__arg=2)
def f2(self):
__arg = 1
class D:
def g(self, __arg):
return __arg
return D().g
if __name__ == "__main__":
import faulthandler; faulthandler.enable()
inst = CMultiplyNested()
name = '_CMultiplyNested__arg'
try:
inst.f1()
except TypeError:
print("TypeError")
closure = inst.f2()
closure(_CMultiplyNested__arg=2)
Output:
$ ./python bug.py
TypeError
Fatal Python error: Segmentation fault
Current thread 0x00007fa713149740 (most recent call first):
File "/home/vstinner/python/3.13/bug.py", line 27 in <module>
Erreur de segmentation (core dumped)