ShaharNaveh · GitHub

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

Read the original on github.com ↗