to stdin within subprocess.Popen.communicate. 5-10% less cpu usage.
self._save_input(input)
+ if self._input:
+ input_view = memoryview(self._input)
+
while self._fd2file:
timeout = self._remaining_time(endtime)
if timeout is not None and timeout < 0:
for fd, mode in ready:
if mode & select.POLLOUT:
- chunk = self._input[self._input_offset :
- self._input_offset + _PIPE_BUF]
+ chunk = input_view[self._input_offset :
+ self._input_offset + _PIPE_BUF]
try:
self._input_offset += os.write(fd, chunk)
except OSError as e:
Library
-------
+- Issue #19506: Use a memoryview to avoid a data copy when piping data
+ to stdin within subprocess.Popen.communicate. 5-10% less cpu usage.
+
- Issue #19839: Fix regression in bz2 module's handling of non-bzip2 data at
EOF, and analogous bug in lzma module.