summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-01-27 10:58:49 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-01-27 10:58:49 (GMT)
commitb7f19ff94b4ec7da7372a23842ea64d0b722adba (patch)
tree81914f40e482be74eec5084e7140ec3c398dd14e
parent9a2e75be2453999a55bbae62aecc4e99899309f2 (diff)
downloadcpython-b7f19ff94b4ec7da7372a23842ea64d0b722adba.zip
cpython-b7f19ff94b4ec7da7372a23842ea64d0b722adba.tar.gz
cpython-b7f19ff94b4ec7da7372a23842ea64d0b722adba.tar.bz2
asyncio: document the IncompleteReadError exception
-rw-r--r--Doc/library/asyncio-stream.rst21
1 files changed, 20 insertions, 1 deletions
diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst
index 27aae32..cffb79b 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 <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
=======