[New-bugs-announce] [issue13578] Add subprocess.iter_output() convenience function

Nick Coghlan report at bugs.python.org
Sun Dec 11 06:05:54 CET 2011


New submission from Nick Coghlan <ncoghlan at gmail.com>:

subprocess.check_output() is nice, but doesn't help if you want to process the piped data line-by-line.

Currently, that means you have to do the full Popen dance if you want access to each line of output as it becomes available.

This RFE is for a subprocess.iter_output() module level helper that:
1. Starts the subprocess
2. Yield the individual lines of output as they are produced by the subprocess
3. Cleans up (including checking for errors) at the end

This biggest challenge I have noticed so far in exploring this is how to handle timeouts on Windows - on Unix, select.select() can do the job, but that won't handle pipes in the Windows case.

----------
components: Library (Lib)
messages: 149210
nosy: ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Add subprocess.iter_output() convenience function
type: feature request
versions: Python 3.3

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


More information about the New-bugs-announce mailing list