.. _subprocess-run-check:

subprocess-run-check / W1510
============================

**Message emitted:**

'subprocess.run' used without explicitly defining the value for 'check'.

**Description:**

*The ``check`` keyword  is set to False by default. It means the process launched by ``subprocess.run`` can exit with a non-zero exit code and fail silently. It's better to set it explicitly to make clear what the error-handling behavior is.*

**Problematic code:**

.. literalinclude:: /data/messages/s/subprocess-run-check/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/s/subprocess-run-check/good.py
   :language: python


**Related links:**

- `subprocess.run documentation <https://docs.python.org/3/library/subprocess.html#subprocess.run>`_

Created by the `stdlib <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/stdlib.py>`__ checker.