New GitHub issue #118733 from ericsnowcurrently:<br>
<hr>
<pre>
# Bug report
### Bug description:
In gh-118532 I was getting crashes when the _testsinglephase module's cached copy of `__dict__` was finalized. I worked around it in that PR by doing an unconditional incref, but that introduced a refleak for other cases. At the time, I wasn't able to determine if gh-118532 was the source of the refcount problem or if it only exposed an existing problem.
While working on gh-118157 I narrowed the problem down to the `__file__` value in the cached `__dict__` and resolved it by interning the string. However, the underlying problem remains: somewhere along the line there seems to be a missing incref.
That needs to be located and fixed, and then the interning can be dropped.
### CPython versions tested on:
CPython main branch
### Operating systems tested on:
_No response_
</pre>
<hr>
<a href="https://github.com/python/cpython/issues/118733">View on GitHub</a>
<p>Labels: type-bug, interpreter-core, 3.13</p>
<p>Assignee: </p>