Skip to content

IOBase.isatty() Missing closed Check #2

@ever0de

Description

@ever0de

Problem: The isatty() method does not check if the file is closed before returning False. CPython raises ValueError when called on closed files.

RustPython Location: crates/vm/src/stdlib/io.rs:480-482

#[pymethod]
fn isatty(_self: PyObjectRef) -> bool {
    false  // ✗ Missing closed check
}

CPython 3.14 Reference: Modules/_io/iobase.c:538-545

static PyObject *
_io__IOBase_isatty_impl(PyObject *self)
{
    if (iobase_check_closed(self))  // ✓ Checks if closed
        return NULL;
    Py_RETURN_FALSE;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions