CPython issue: python/cpython#146091
tcsetwinsize in Modules/termios.c (lines 502-510) passes the result of PySequence_GetItem directly to PyLong_AsLong without NULL check. On error, PyLong_AsLong(NULL) calls PyErr_BadInternalCall() → SystemError masks the real error.
Check PySequence_GetItem return for NULL before calling PyLong_AsLong.