]> granicus.if.org Git - python/commitdiff
asyncio: document the IncompleteReadError exception
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 27 Jan 2014 10:58:49 +0000 (11:58 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 27 Jan 2014 10:58:49 +0000 (11:58 +0100)
Doc/library/asyncio-stream.rst

index 27aae32d0f55003a3e7eb317b9d4ab4fa941a243..cffb79be1cc95c61111bed280114a979ec92f428 100644 (file)
@@ -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 <coroutine>`.
 
@@ -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
 =======