Skip to content

_pyio.TextIOBase.read is missing a size arg #151596

@ShaharNaveh

Description

@ShaharNaveh

Bug report

Bug description:

IOBase:

def readline(self, size=-1):

TextIOBase:

def readline(self):


This pattern seems to be missing only for readline AFAICT.
for truncate (which is also "unsupported" for TextIOBase) it's preserved:

IOBase:

def truncate(self, pos=None):

TextIOBase:

def truncate(self, pos=None):

(the same for write and others).

My proposed fix should be adding a size argument to readline with a default value of -1

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions