[Python-checkins] cpython: asyncio: document the IncompleteReadError exception
victor.stinner
python-checkins at python.org
Mon Jan 27 11:59:05 CET 2014
http://hg.python.org/cpython/rev/9bff2458b7a0
changeset: 88774:9bff2458b7a0
user: Victor Stinner <victor.stinner at gmail.com>
date: Mon Jan 27 11:58:49 2014 +0100
summary:
asyncio: document the IncompleteReadError exception
files:
Doc/library/asyncio-stream.rst | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst
--- a/Doc/library/asyncio-stream.rst
+++ b/Doc/library/asyncio-stream.rst
@@ -98,7 +98,10 @@
.. 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 @@
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
=======
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list