[issue40497] subprocess.check_output() accept the check keyword argument

2021-09-20 Thread Łukasz Langa

Łukasz Langa  added the comment:

Fixed with GH-19897 for Python 3.11. Thanks! ✨  ✨

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.11 -Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40497] subprocess.check_output() accept the check keyword argument

2021-09-20 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 4d2957c1b9a915f76da418e89bf9b5add141ca3e by Rémi Lapeyre in 
branch 'main':
bpo-40497: Fix handling of check in subprocess.check_output() (GH-19897)
https://github.com/python/cpython/commit/4d2957c1b9a915f76da418e89bf9b5add141ca3e


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40497] subprocess.check_output() accept the check keyword argument

2020-05-04 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

> Now a reviewer has to check that a developer uses the validate_result() 
> function *and* the developer is not passing validate=False into the function.

Fair enough, I updated the PR to raise ValueError instead.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40497] subprocess.check_output() accept the check keyword argument

2020-05-04 Thread Christian Heimes


Christian Heimes  added the comment:

IMHO it's both confusing and bad API design to have a function like

validate_result(..., validate=False)

Now a reviewer has to check that a developer uses the validate_result() 
function *and* the developer is not passing validate=False into the function.

GH-19897 is also provides a new feature, so it cannot get into Python 3.7 and 
3.8.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40497] subprocess.check_output() accept the check keyword argument

2020-05-04 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

> check_output() should not accept check=False.

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?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40497] subprocess.check_output() accept the check keyword argument

2020-05-04 Thread Christian Heimes


Christian Heimes  added the comment:

-1

check_output() should not accept check=False. Please only improve the error 
message. I would be fine with accepting check=True, too

--
nosy: +christian.heimes
stage: patch review -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40497] subprocess.check_output() accept the check keyword argument

2020-05-04 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
keywords: +patch
pull_requests: +19208
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19897

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40497] subprocess.check_output() accept the check keyword argument

2020-05-04 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

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 "", line 1, in 
  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.

--
components: Library (Lib)
messages: 368027
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: subprocess.check_output() accept the check keyword argument
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com