You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The subprocess.check_output() raises TypeError when given the check keyword-argument:
Python 3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.check_output(['ls'], check=False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
TypeError: run() got multiple values for keyword argument 'check'
It should just use True as the default when it's not specified in kwargs.
I thought about raising ValueError instead but subprocess.check_output([...], check=False) is actually a convenient shortcut over subprocess.run([...], stdout=subprocess.PIPE).stdout and I can't think of much drawbacks if someone explicitly ask for the check to be disabled. Is there any way we could have that?