Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-90102: Remove isatty call during regular open #124922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 8, 2024
Prev Previous commit
Merge branch 'main' into cmaloney/stat_atopen_skip_isatty_t3
Update for gh-111178
  • Loading branch information
cmaloney committed Oct 7, 2024
commit 882867ca257c3598b6cba96d752532ebbb63e61a
7 changes: 4 additions & 3 deletions 7 Modules/_io/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1224,8 +1224,9 @@ _io_FileIO_isatty_impl(fileio *self)
context TOCTOU issues (the fd could be arbitrarily modified by
surrounding code). */
static PyObject *
_io_FileIO_isatty_open_only(fileio *self, void *Py_UNUSED(ignored))
_io_FileIO_isatty_open_only(PyObject *op, PyObject *Py_UNUSED(ignored))
{
fileio *self = _PyFileIO_CAST(op);
if (self->stat_atopen != NULL && !S_ISCHR(self->stat_atopen->st_mode)) {
Py_RETURN_FALSE;
}
Expand All @@ -1248,8 +1249,8 @@ static PyMethodDef fileio_methods[] = {
_IO_FILEIO_WRITABLE_METHODDEF
_IO_FILEIO_FILENO_METHODDEF
_IO_FILEIO_ISATTY_METHODDEF
{"_isatty_open_only", (PyCFunction)_io_FileIO_isatty_open_only, METH_NOARGS},
{"_dealloc_warn", (PyCFunction)fileio_dealloc_warn, METH_O, NULL},
{"_isatty_open_only", _io_FileIO_isatty_open_only, METH_NOARGS},
{"_dealloc_warn", fileio_dealloc_warn, METH_O, NULL},
{"__reduce__", _PyIOBase_cannot_pickle, METH_NOARGS},
{"__reduce_ex__", _PyIOBase_cannot_pickle, METH_O},
{NULL, NULL} /* sentinel */
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.