Skip to content

IOBase.fileno() Error Message Bug #1

@ever0de

Description

@ever0de

Problem: The error message in fileno() method incorrectly refers to "truncate" instead of "fileno".

RustPython Location: crates/vm/src/stdlib/io.rs:437-438

#[pymethod]
fn fileno(zelf: PyObjectRef, vm: &VirtualMachine) -> PyResult {
    _unsupported(vm, &zelf, "truncate")  // ✗ Should be "fileno"
}

CPython 3.14 Reference: Modules/_io/iobase.c:522-527

static PyObject *
_io__IOBase_fileno_impl(PyObject *self, PyTypeObject *cls)
{
    _PyIO_State *state = get_io_state_by_cls(cls);
    return iobase_unsupported(state, "fileno");  // ✓ Correct message
}

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