This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author izbyshev
Recipients ThiefMaster, gregory.p.smith, izbyshev
Date 2020-11-22.17:12:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1606065137.24.0.0443780384706.issue42388@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-11-22 17:12:17izbyshevsetrecipients: + izbyshev, gregory.p.smith, ThiefMaster
2020-11-22 17:12:17izbyshevsetmessageid: <1606065137.24.0.0443780384706.issue42388@roundup.psfhosted.org>
2020-11-22 17:12:17izbyshevlinkissue42388 messages
2020-11-22 17:12:17izbyshevcreate