You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SystemError from termios.tcsetwinsizepassing NULL to PyLong_AsLong #146091
It's possible to raise SystemError from termios.tcsetwinsize by passing a sequence that raises on __getitem__ to it.
Automated diagnosis:
Bug: termios.tcsetwinsize passes NULL to PyLong_AsLong. PySequence_GetItem(winsz, 0) can return NULL (e.g., __getitem__ raises). The result is passed directly to PyLong_AsLong(NULL) which calls PyErr_BadInternalCall(), masking the real error with SystemError.
@devdanzin This is interesting. Let me work on this issue. I do understand the problem is that PySequence_GetItem can return NULL, which gets passed to PyLong_AsLong, causing a SystemError instead of the original exception. I'll add NULL checks and proper error propagation, and any suggestions that can help?
Activity
okiemute04 commentedon Mar 18, 2026
@devdanzin This is interesting. Let me work on this issue. I do understand the problem is that PySequence_GetItem can return NULL, which gets passed to PyLong_AsLong, causing a SystemError instead of the original exception. I'll add NULL checks and proper error propagation, and any suggestions that can help?
pythongh-146091: Fix NULL check in termios.tcsetwinsize
pythongh-146091: Fix NULL check in termios.tcsetwinsize
pythongh-146091: Fix NULL check in termios.tcsetwinsize
gh-146091: Fix NULL check in termios.tcsetwinsize (#146147)
pythongh-146091: Fix NULL check in termios.tcsetwinsize (python#146147)