On this page
asyncio.IncompleteReadError
Prev: asyncio.Handle | Up: asyncio | Next: asyncio.iscoroutine
Rel: asyncio.AbstractEventLoop, asyncio.AbstractServer, asyncio.all_tasks, asyncio.as_completed
Ref: docs.python.org โ asyncio.IncompleteReadError
Tags: #public #python3 #stdlib #asyncio
Import
import asyncio
from asyncio import IncompleteReadError
Signature & Overview
asyncio.IncompleteReadError(partial, expected)
Incomplete read error. Attributes: - partial: read bytes string before the end of stream was reached - expected: total number of expected bytes (or None if unknown)
Methods & Attributes
IncompleteReadError.add_note(self, note, /)โ Add a note to the exceptionIncompleteReadError.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import asyncio
exc = asyncio.IncompleteReadError(partial=b"abc", expected=10)
assert exc.partial == b"abc" and exc.expected == 10
Gotchas
- Raised by
StreamReader.readexactly()/readuntil()on premature EOF: Inspectexc.partialfor bytes received before the peer closed the connection.
REPL Inspect
from asyncio import IncompleteReadError
help(IncompleteReadError)
Linked from
Related notes
- tuts/python3/stdlib_module/asyncio/Handle Linked here; links to this page; shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/iscoroutine Linked here; links to this page; shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/asyncio/AbstractEventLoop Linked here; shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/AbstractServer Linked here; shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/all_tasks Linked here; shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/as_completed Linked here; shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/Barrier shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/BaseEventLoop shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/BaseProtocol shared tags: #asyncio, #stdlib