Author martin.panter
Recipients docs@python, gvanrossum, martin.panter, python-dev, socketpair, vstinner, yselivanov
Date 2016-08-19.06:56:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1471589786.28.0.0426056892213.issue26050@psf.upfronthosting.co.za>
In-reply-to
Content
In revision 83450939b106, Yury added some documentation for readuntil(). I am not familiar with this StreamReader class, but maybe Mark or someone else can check if the remaining changes in his patch are still useful.

I can suggest some spelling and wording fixes however. Bits in square brackets are my changes.

## read(n=-1):

If *n* is zero, return [an] empty ``bytes`` object [immediately (single L)].

If *n* is positive, this function [tries] to read *n* bytes, [but may return less]. If EOF was received before any byte is read, this function returns [an] empty [bytes] object[, otherwise it returns at least one byte].

[The] returned value is not limited [by] [*limit* (add asterisks)], . . .

If [the] stream was paused, . . .

## readline():

Read [] from the stream until [a] newline (``b'\n'``) is found.

On success, return [the line, which] ends with [a] newline. If only [a] partial line can be read due to EOF, return [an] incomplete line without terminating newline. When EOF was reached [and] no bytes [were] read, [an] empty ``bytes`` object is returned.

If [*limit* (add asterisks)] is reached, ValueError will be raised. In that case, if [a] newline was found, [the] complete line including newline will be removed from [the] internal buffer. [Otherwise, the] internal buffer will be cleared. [*Limit* (add asterisks)] is compared against [the length] of the line[, not counting the] newline.

If [the] stream was paused, . . .

## readexactly(n):

If *n* is zero, return [an] empty bytes object.

[The] returned value is not limited by [*limit* (add asterisks)], . . .

If [the] stream was paused, . . .

## readuntil(separator=b'\n'):

Read [] from the stream until *separator* is found.

On success, [the] chunk [of data] and its separator will be removed from [the] internal buffer (i.e. consumed). [The] returned chunk will include [the] separator at the end.

[The] configured stream limit is used to [limit the] result. [*Limit* (add asterisks)] means [the maximum] length of [the] chunk . . .

If EOF occurs and [a] complete separator [is] still not found, :exc:`IncompleteReadError`(<partial data>, None) will be raised and [the] internal buffer becomes empty. . . .

If [the] chunk cannot be read due to [the] limit, :exc:`LimitOverrunError` will be raised and data will be left in [the] internal buffer, . . .

If [the] stream was paused, . . .
History
Date User Action Args
2016-08-19 06:56:26martin.pantersetrecipients: + martin.panter, gvanrossum, vstinner, docs@python, socketpair, python-dev, yselivanov
2016-08-19 06:56:26martin.pantersetmessageid: <1471589786.28.0.0426056892213.issue26050@psf.upfronthosting.co.za>
2016-08-19 06:56:26martin.panterlinkissue26050 messages
2016-08-19 06:56:24martin.pantercreate