[New-bugs-announce] [issue23236] asyncio: add timeout to StreamReader read methods

STINNER Victor report at bugs.python.org
Wed Jan 14 01:48:28 CET 2015

New submission from STINNER Victor:

Attached patch adds an optional timeout parameter to the read(), read_exactly() and readline() methods of StreamReader.

If a single read takes longer than timeout seconds, a asyncio.TimeoutError is raised. The timeout is reset each time new data is received.

Read data is pushed back to the StreamReader buffer if the wait raises an exception (timeout, cancelled, etc.), so it's possible to retry the read later.

components: asyncio
files: streamreader_timeout.patch
keywords: patch
messages: 233978
nosy: gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: add timeout to StreamReader read methods
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file37697/streamreader_timeout.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list