diff --git a/CHANGES/13686.doc.rst b/CHANGES/13686.doc.rst new file mode 100644 index 00000000000..dfdda30ed4c --- /dev/null +++ b/CHANGES/13686.doc.rst @@ -0,0 +1,3 @@ +Corrected the documented signature of :py:meth:`~aiohttp.StreamReader.readuntil`, which +showed a ``str`` separator although the method takes ``bytes``, and documented its +keyword-only ``max_size`` argument -- by :user:`hxperl`. diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index fec05a6644a..df269e16d02 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -157,6 +157,7 @@ Gary Leung Gary Wilson Jr. Gene Hoffman Gennady Andreyev +Geonseok Lee George Fifth Georges Dubus goingforstudying-ctrl diff --git a/docs/streams.rst b/docs/streams.rst index c74a0c1ad93..cbbcf44d751 100644 --- a/docs/streams.rst +++ b/docs/streams.rst @@ -79,7 +79,7 @@ Reading Attributes and Methods :return bytes: the given line -.. method:: StreamReader.readuntil(separator="\n") +.. method:: StreamReader.readuntil(separator=b"\n", *, max_size=None) :async: Read until separator, where `separator` is a sequence of bytes. @@ -92,6 +92,10 @@ Reading Attributes and Methods .. versionadded:: 3.8 + :param int max_size: maximum number of bytes to buffer while searching for + *separator*; exceeding it raises ``LineTooLong``. ``None``, the default, + uses the stream's high-water limit. + :return bytes: the given data .. method:: StreamReader.readchunk()