-
-
Notifications
You must be signed in to change notification settings - Fork 34.8k
_pyio.TextIOBase.read is missing a size arg #151596
Copy link
Copy link
Open
Labels
pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-IOtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Metadata
Metadata
Assignees
Labels
pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-IOtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Fields
Give feedbackNo fields configured for issues without a type.
Bug report
Bug description:
IOBase:cpython/Lib/_pyio.py
Line 513 in a064b32
TextIOBase:cpython/Lib/_pyio.py
Line 1931 in a064b32
This pattern seems to be missing only for
readlineAFAICT.for
truncate(which is also "unsupported" forTextIOBase) it's preserved:IOBase:cpython/Lib/_pyio.py
Line 370 in a064b32
TextIOBase:cpython/Lib/_pyio.py
Line 1927 in a064b32
(the same for
writeand others).My proposed fix should be adding a
sizeargument toreadlinewith a default value of-1CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux