diff options
author | Vincent Michel <vxgmichel@gmail.com> | 2018-11-08 12:21:47 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2018-11-08 12:21:47 (GMT) |
commit | fd512d76456b65c529a5bc58d8cfe73e4a10de7a (patch) | |
tree | 0a3f0c1943f446a886837ea1234021b4e1a9203c /Lib/asyncio | |
parent | 5d95312fb8eb1684879b9fb8c5c928089326d0df (diff) | |
download | cpython-fd512d76456b65c529a5bc58d8cfe73e4a10de7a.zip cpython-fd512d76456b65c529a5bc58d8cfe73e4a10de7a.tar.gz cpython-fd512d76456b65c529a5bc58d8cfe73e4a10de7a.tar.bz2 |
bpo-35065: Remove `StreamReaderProtocol._untrack_reader` (#10212)
The call to `_untrack_reader` is performed too soon, causing the protocol
to forget about the reader before `connection_lost` can run and feed the
EOF to the reader. See bpo-35065.
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/streams.py | 6 | ||||
-rw-r--r-- | Lib/asyncio/subprocess.py | 5 |
2 files changed, 0 insertions, 11 deletions
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py index 0afc66a..33fc303 100644 --- a/Lib/asyncio/streams.py +++ b/Lib/asyncio/streams.py @@ -227,9 +227,6 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): self._reject_connection = True self._stream_reader_wr = None - def _untrack_reader(self): - self._stream_reader_wr = None - @property def _stream_reader(self): if self._stream_reader_wr is None: @@ -345,9 +342,6 @@ class StreamWriter: return self._transport.can_write_eof() def close(self): - # a reader can be garbage collected - # after connection closing - self._protocol._untrack_reader() self._transport.close() def is_closing(self): diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py index c86de3d..90fc00d 100644 --- a/Lib/asyncio/subprocess.py +++ b/Lib/asyncio/subprocess.py @@ -36,11 +36,6 @@ class SubprocessStreamProtocol(streams.FlowControlMixin, info.append(f'stderr={self.stderr!r}') return '<{}>'.format(' '.join(info)) - def _untrack_reader(self): - # StreamWriter.close() expects the protocol - # to have this method defined. - pass - def connection_made(self, transport): self._transport = transport |