Skip to content

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

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

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-IOtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions