New GitHub issue #118934 from colesbury:<br>

<hr>

<pre>
`PyEval_GetLocals()` is documented as returning a [borrowed reference](https://docs.python.org/3/c-api/reflection.html#c.PyEval_GetLocals). 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 
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/118934">View on GitHub</a>
<p>Labels: type-bug, topic-C-API, 3.13, 3.14</p>
<p>Assignee: </p>