Message381622
It seems that allowing `input=None` to mean "redirect stdin to a pipe and send an empty string there" in `subprocess.check_output` was an accident(?), and this behavior is inconsistent with `subprocess.run` and `communicate`, where `input=None` has the same effect as not specifying it at all.
The docs for `subprocess.check_output` say:
The arguments shown above are merely some common ones. The full function signature is largely the same as that of run() - most arguments are passed directly through to that interface. However, explicitly passing input=None to inherit the parent’s standard input file handle is not supported.
They don't make it clear the effect of passing `input=None` though. I also couldn't find any tests that would check that effect.
Since we can't just forbid `input=None` for `check_output` at this point (probably can't even limit that to the case when `text` is used, since it was added in 3.7), I think that we need to extend the check pointed to by ThiefMaster to cover `text`, clarify the docs and add a test. |
|
Date |
User |
Action |
Args |
2020-11-22 17:12:17 | izbyshev | set | recipients:
+ izbyshev, gregory.p.smith, ThiefMaster |
2020-11-22 17:12:17 | izbyshev | set | messageid: <1606065137.24.0.0443780384706.issue42388@roundup.psfhosted.org> |
2020-11-22 17:12:17 | izbyshev | link | issue42388 messages |
2020-11-22 17:12:17 | izbyshev | create | |
|