mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
gh-97825: fix AttributeError when calling subprocess.check_output(input=None) with encoding or errors args (#97826)
* fix AttributeError, add unit test
This commit is contained in:
parent
0ceafa7fa4
commit
db64fb9bbe
3 changed files with 9 additions and 1 deletions
|
@ -238,6 +238,12 @@ class ProcessTestCase(BaseTestCase):
|
|||
input=None, universal_newlines=True)
|
||||
self.assertNotIn('XX', output)
|
||||
|
||||
def test_check_output_input_none_encoding_errors(self):
|
||||
output = subprocess.check_output(
|
||||
[sys.executable, "-c", "print('foo')"],
|
||||
input=None, encoding='utf-8', errors='ignore')
|
||||
self.assertIn('foo', output)
|
||||
|
||||
def test_check_output_stdout_arg(self):
|
||||
# check_output() refuses to accept 'stdout' argument
|
||||
with self.assertRaises(ValueError) as c:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue