[New-bugs-announce] [issue42388] subprocess.check_output(['echo', 'test'], text=True, input=None) fails

ThiefMaster report at bugs.python.org
Tue Nov 17 08:56:29 EST 2020


New submission from ThiefMaster <adrian at planetcoding.net>:

`subprocess.check_output(['echo', 'test'], text=True, input=None)` fails with `AttributeError: 'bytes' object has no attribute 'encode'` due to the function only checking for `universal_newlines` but not `text`: https://github.com/python/cpython/blob/2ffba2a1027909e1dd697bf8ec2a03fba7618020/Lib/subprocess.py#L423

This is inconsistent with the docs, which state that "text was added as a more readable alias for universal_newlines.".

----------
components: Library (Lib)
messages: 381234
nosy: ThiefMaster
priority: normal
severity: normal
status: open
title: subprocess.check_output(['echo', 'test'], text=True, input=None) fails
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42388>
_______________________________________


More information about the New-bugs-announce mailing list