From: Victor Stinner Date: Mon, 27 Jan 2014 10:58:49 +0000 (+0100) Subject: asyncio: document the IncompleteReadError exception X-Git-Tag: v3.4.0rc1~222 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b7f19ff94b4ec7da7372a23842ea64d0b722adba;p=thirdparty%2FPython%2Fcpython.git asyncio: document the IncompleteReadError exception --- diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst index 27aae32d0f55..cffb79be1cc9 100644 --- a/Doc/library/asyncio-stream.rst +++ b/Doc/library/asyncio-stream.rst @@ -98,7 +98,10 @@ StreamReader .. method:: readexactly(n) - XXX + Read exactly *n* bytes. Raise an :exc:`IncompleteReadError` if the end of + the stream is reached before *n* can be read, the + :attr:`IncompleteReadError.partial` attribute of the exception contains + the partial read bytes. This method returns a :ref:`coroutine object `. @@ -208,6 +211,22 @@ StreamReaderProtocol XXX +IncompleteReadError +=================== + +.. exception:: IncompleteReadError + + Incomplete read error. + + .. attribute:: expected + + Total number of expected bytes (:class:`int`). + + .. attribute:: partial + + Read bytes string before the end of stream was reached (:class:`bytes`). + + Example =======