◐ Shell
clean mode source ↗

gh-146091: Fix NULL check in termios.tcsetwinsize by okiemute04 · Pull Request #146147 · python/cpython

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@okiemute04

@okiemute04 okiemute04 commented

Mar 18, 2026

edited by bedevere-app Bot

Loading

Fixes #146091

Add proper NULL checks for PySequence_GetItem results before passing
to PyLong_AsLong, this prevents SystemError when a BadSequence raises
TypeError in getitem, the issue was that PySequence_GetItem can return NULL, which when passed to PyLong_AsLong would cause an internal error instead of propagating
the original exception.

@bedevere-app

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@python-cla-bot

All commit authors signed the Contributor License Agreement.

CLA signed

Add proper NULL checks for PySequence_GetItem results before passing
to PyLong_AsLong. This prevents SystemError when a BadSequence raises
TypeError in __getitem__.

kumaraditya303

ljfp pushed a commit to ljfp/cpython that referenced this pull request

Apr 25, 2026

2 participants

@okiemute04 @kumaraditya303