plumbum hides stderr of pipes
See original GitHub issueType "help", "copyright", "credits" or "license" for more information.
>>> from plumbum.cmd import cat, head
>>> from plumbum import FG
>>> cat['/dev/urndom'] & FG(1)
/bin/cat: /dev/urndom: No such file or directory
>>> (cat['/dev/urndom'] | head['-c', '10']) & FG(retcode=1)
>>>
I would expect to see the standard error output of cat printed to the stderr of the Python process. For instance, zsh shows this:
❯❯❯ /bin/cat /dev/urndom | head -c10
/bin/cat: /dev/urndom: No such file or directory
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Source code for plumbum.commands.modifiers
Source code for plumbum.commands.modifiers ... Ignore hidden properties. ... BG>`), their stdout/stderr pipes might fill up, causing them to hang.
Read more >Python Subprocess Module - Running external programs
using stdin.write / stdout.read; using PIPE with check_call/check_output/call ... By merging STDERR into STDOUT, the external program's errors can be hidden ...
Read more >Hide stderr and pipe stdout in tcsh - linux - Stack Overflow
How can I hide stderr but use stdout in csh script? I'm trying to find occurrences in some file which may exist or...
Read more >Child process | Node.js v19.3.0 Documentation
By default, pipes for stdin , stdout , and stderr are established between the parent Node.js process and the spawned subprocess. These pipes...
Read more >What is stdout, stderr, /dev/null and redirection? - YouTube
Surely you've heard other talk about stderr or "Standard Error". Similarly there is "stdout" or "Standard Out". But what do they mean.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I don’t want to capture stderr. It should be printed to actual
sys.stderrand not discarded. If you do in e.g. Bashyou get stdout into
$foobut stderr will still be printed to shell’s stderr. Plumbum seems to discard it for no reason.@woky I looked up the docstring for
__call__, and found that it says “A shortcut for run(args), returning only the process’ stdout”. I was able to get output going to sys.stderr by doing:If instead capturing stderr is preferred, one can do: