[issue36981] asyncio transport.write() memory out
viocal
report at bugs.python.org
Tue May 21 23:28:26 EDT 2019
viocal <viocal at tom.com> added the comment:
I have fixed it
modified selector_events.py
def write(self, data):
if not isinstance(data, (bytes, bytearray, memoryview)):
raise TypeError(f'data argument must be a bytes-like object, '
f'not {type(data).__name__!r}')
...
if not self._buffer:
# Optimization: try to send now.
while True: #########add by viocal
try:
n = self._sock.send(data)
except (BlockingIOError, InterruptedError):
pass
except Exception as exc:
self._fatal_error(exc, 'Fatal write error on socket transport')
return
else:
data = data[n:]
if not data:
return
# Not all was written; register write handler.
self._loop._add_writer(self._sock_fd, self._write_ready)
# Add it to the buffer.
self._buffer.extend(data)
self._maybe_pause_protocol()
----------
resolution: -> fixed
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36981>
_______________________________________
More information about the Python-bugs-list
mailing list