When used as an entry point, the `trace` module opens code files without using `io.open_code`: https://github.com/python/cpython/blob/main/Lib/trace.py#L719 This should use the `io.open_code` method instead of `open(..., 'rb')`. <!-- gh-linked-prs --> ### Linked PRs * gh-103947 * gh-103950 * gh-103952 * gh-103953 * gh-103954 <!-- /gh-linked-prs -->