Registry / devops / subprocess-multitee

subprocess-multitee

JSON →
library0.2.1pypypiunverified

Provides a `multitee` function that splits stdout/stderr from subprocesses into multiple sinks (e.g., files, pipes, callables), along with a `Popen` wrapper. Currently at v0.2.1, requires Python >= 3.6. Low release cadence; last release Nov 2023.

devops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

from subprocess_multitee import multitee
from subprocess_multitee import Popen
from subprocess_multitee import CompletedProcess

Basic usage: split subprocess output into multiple sinks (callables, file objects, etc.) using the Popen wrapper.

from subprocess_multitee import multitee, Popen # Capture stdout and stderr to both a list and a file out = [] err = [] proc = Popen( ['echo', 'hello'], stdout=multitee(lambda line: out.append(line), open('/tmp/stdout.log', 'w')), stderr=multitee(lambda line: err.append(line), open('/tmp/stderr.log', 'w')), text=True ) proc.wait()
Debug
Known footguns
gotchaThe `multitee` function expects writable objects that accept lines (e.g., file objects opened with 'w' and callables that take a string). Do not pass binary streams unless you set `text=True` in Popen.
breakingA bug in v0.1.1 and earlier could stall subprocess writes when reading single bytes. v0.2.0 resolved this by using an internal queue.
gotchaThe `Popen` wrapper does not mirror the full `subprocess.Popen` interface. Arguments like `bufsize`, `pipesize`, or `pass_fds` may not be supported.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources