[issue22685] memory leak: no transport for pipes by create_subprocess_exec/shell

wabu report at bugs.python.org
Tue Oct 21 22:12:10 CEST 2014


wabu added the comment:

Here's a more complete example

@coroutine
put_data(filename, queue, chunksize=16000):
    pbzip2 = yield from asyncio.create_subprocess_exec(
                 'pbzip2', '-cd', filename, 
                 stdout=asyncio.subprocess.PIPE, limit=self.chunksize*2)

    while not pbzip2.stdout.at_eof():
        data = yield from pbzip2.stdout.read(chunksize)
        yield from queue.put(data)

adding the workaround after createing the stream fixes the issue:
pbzip2.stdout.set_transport(pbzip2._transport.get_pipe_transport(1))

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22685>
_______________________________________


More information about the Python-bugs-list mailing list