Passing the NUL character in a struct format string was undefined behaviour in CPython.
PyPy handles it correctly, but the CPython fix introduced a different error message that is causing failures in lib-python.3.test.test_struct
, which will be fixed by this PR.
Because the error message is coming from RPython, this PR changes it in both PyPy2 and PyPy3, even though it was not fixed for CPython2.
https://bugs.python.org/issue35714, https://github.com/python/cpython/pull/16928/files