.. _invalid-envvar-default:

invalid-envvar-default / W1508
==============================

**Message emitted:**

``%s default type is %s. Expected str or None.``

**Description:**

*Env manipulation functions return None or str values. Supplying anything different as a default may cause bugs. See https://docs.python.org/3/library/os.html#os.getenv.*

**Problematic code:**

.. literalinclude:: /data/messages/i/invalid-envvar-default/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/i/invalid-envvar-default/good.py
   :language: python





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