From: Zachary Sailer Date: Sun, 9 Jun 2019 21:15:31 +0000 (-0700) Subject: iostream: check that stream is open before trying to read (#2670) X-Git-Tag: v6.1.0b1~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbd1a8fb95d1d24acd100426077c37d6f77e497b;p=thirdparty%2Ftornado.git iostream: check that stream is open before trying to read (#2670) --- diff --git a/tornado/iostream.py b/tornado/iostream.py index 6ea748a54..ee305922d 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -794,6 +794,7 @@ class BaseIOStream(object): self._read_from_buffer(pos) def _start_read(self) -> Future: + self._check_closed() # Before reading, check that stream is not closed. assert self._read_future is None, "Already reading" self._read_future = Future() return self._read_future