tomerfiliba / plumbum

Plumbum: Shell Combinators
https://plumbum.readthedocs.io
MIT License
2.79k stars 182 forks source link

made StdinDataRedirection compatible with modifiers writing to stdout #605

Closed jesteria closed 2 years ago

jesteria commented 2 years ago

I.e. fixed:

(cat << "meow") & FG

Modifiers writing to stdout – e.g.: FG, TEE, RETCODE(FG=True) and TF(FG=True) – invoke commands with the specification stdin=None. This is handled correctly by BaseCommand; however, StdinDataRedirection misinterprets this as a further attempt to specify stdin (i.e. to specify something rather than nothing).

This change brings StdinDataRedirection in line with its base class, ignoring None as well as PIPE.

(Though a technical detail, the class would also have failed any invocation setting stdin=PIPE, along the lines of: "TypeError: got multiple values for keyword argument 'stdin'". The kwargs passed to the wrapped command's popen are corrected as well.)

resolves #604

coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.09%) to 83.673% when pulling ac15f1c6452372756816630b430e31af5738c224 on jesteria:604-fix-stdin-data-modifiers into 5fa1452846aae4a1fd2904bf145b0801c2050508 on tomerfiliba:master.

henryiii commented 2 years ago

Thanks!!!