cpython icon indicating copy to clipboard operation
cpython copied to clipboard

`PyEval_GetLocals()` leaks locals

Open colesbury opened this issue 3 months ago • 1 comments

Bug report

PyEval_GetLocals() is documented as returning a borrowed reference. It now returns a new reference, which causes callers to leak the local variables:

https://github.com/python/cpython/blob/35c436186b849f8f2f9fb866c59015c9d034d448/Python/ceval.c#L2478-L2479

cc @gaogaotiantian @markshannon

colesbury avatar May 10 '24 23:05 colesbury