Skip to content

gh-90102: Fix pyio return value#125089

Merged
vstinner merged 1 commit intopython:mainfrom
cmaloney:cmaloney/gh90102-fixup
Oct 8, 2024
Merged

gh-90102: Fix pyio return value#125089
vstinner merged 1 commit intopython:mainfrom
cmaloney:cmaloney/gh90102-fixup

Conversation

@cmaloney
Copy link
Contributor

@cmaloney cmaloney commented Oct 8, 2024

Spotted by @ngnpope (https://github.com/python/cpython/pull/124922/files#r1791363776).

isatty returns False to indicate the file is not a TTY. The C implementation of _io does that (Py_RETURN_FALSE) but I got the bool backwards in the _pyio implementaiton.

cc: @vstinner

Spotted by @ngnpope.

`isatty` returns False to indicate the file is not a TTY. The C
implementation of _io does that (`Py_RETURN_FALSE`) but I got the
bool backwards in the _pyio implementaiton.
@vstinner
Copy link
Member

vstinner commented Oct 8, 2024

Oops, hopefully the bug was spotted quickly :-)

@vstinner vstinner merged commit 43ad3b5 into python:main Oct 8, 2024
@cmaloney cmaloney deleted the cmaloney/gh90102-fixup branch October 8, 2024 16:16
efimov-mikhail pushed a commit to efimov-mikhail/cpython that referenced this pull request Oct 9, 2024
Spotted by @ngnpope.

`isatty` returns False to indicate the file is not a TTY. The C
implementation of _io does that (`Py_RETURN_FALSE`) but I got the
bool backwards in the _pyio implementaiton.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants