Skip to content

Commit cf4386a

Browse files
committed
gh-143412: Fix TypeError: _IOBase.readlines() takes no keyword arguments
Enable keyword arguments for _IOBase.readline() and _IOBase.readlines() by removing the positional-only parameter marker.
1 parent 9609574 commit cf4386a

File tree

6 files changed

+88
-19
lines changed

6 files changed

+88
-19
lines changed

Include/internal/pycore_global_objects_fini_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_global_strings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ struct _Py_global_strings {
513513
STRUCT_FOR_ID(header)
514514
STRUCT_FOR_ID(headers)
515515
STRUCT_FOR_ID(hi)
516+
STRUCT_FOR_ID(hint)
516517
STRUCT_FOR_ID(hook)
517518
STRUCT_FOR_ID(hour)
518519
STRUCT_FOR_ID(hours)

Include/internal/pycore_runtime_init_generated.h

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_unicodeobject_generated.h

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_io/clinic/iobase.c.h

Lines changed: 78 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_io/iobase.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,6 @@ _io__IOBase_isatty_impl(PyObject *self)
553553
/*[clinic input]
554554
_io._IOBase.readline
555555
size as limit: Py_ssize_t(accept={int, NoneType}) = -1
556-
/
557556
558557
Read and return a line from the stream.
559558
@@ -566,7 +565,7 @@ terminator(s) recognized.
566565

567566
static PyObject *
568567
_io__IOBase_readline_impl(PyObject *self, Py_ssize_t limit)
569-
/*[clinic end generated code: output=4479f79b58187840 input=d0c596794e877bff]*/
568+
/*[clinic end generated code: output=4479f79b58187840 input=5ed037c83054bf41]*/
570569
{
571570
/* For backwards compatibility, a (slowish) readline(). */
572571

@@ -703,7 +702,7 @@ iobase_iternext(PyObject *self)
703702
/*[clinic input]
704703
_io._IOBase.readlines
705704
hint: Py_ssize_t(accept={int, NoneType}) = -1
706-
/
705+
707706
708707
Return a list of lines from the stream.
709708
@@ -714,7 +713,7 @@ lines so far exceeds hint.
714713

715714
static PyObject *
716715
_io__IOBase_readlines_impl(PyObject *self, Py_ssize_t hint)
717-
/*[clinic end generated code: output=2f50421677fa3dea input=9400c786ea9dc416]*/
716+
/*[clinic end generated code: output=2f50421677fa3dea input=ca109061c220173b]*/
718717
{
719718
Py_ssize_t length = 0;
720719
PyObject *result, *it = NULL;

0 commit comments

Comments
 (0)