Repro: ```python import _imp >>> _imp.get_frozen_object('x', b"6\'\xd5Cu\x12") ``` Output: ``` python: Objects/object.c:541: PyObject_Repr: Assertion `!_PyErr_Occurred(tstate)' failed. Aborted (core dumped) ``` I'll submit a PR. <!-- gh-linked-prs --> ### Linked PRs * gh-105980 * gh-106055 * gh-106100 <!-- /gh-linked-prs -->