PyPy raises denormalized exceptions through cpyext
In the pybind11 project, we discovered that PyPy raises certain exceptions to extension modules without normalizing them (calling PyErr_NormalizeException first). For example, the extension module will get an OSError instead of normalizing it to FileNotFoundError.
This is a behavioral difference from CPython, which always normalizes the exception before extension modules can see them. (Although it does pass denormalized exceptions around internally from time to time.)
The details that produced the issue are here, along with a sample code using pybind11 that demonstrates the issue. https://github.com/pybind/pybind11/issues/4075 https://github.com/pybind/pybind11/pull/4079
The code submitted in the example issue has been added to the test suite. Setting up a pybind11 project and running it against PyPy with the #ifdef PYPY removed would demonstrate the issue.