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.

Correct code:

import os

env = os.getenv('SECRET_KEY', '1')

Problematic code:

import os

env = os.getenv('SECRET_KEY', 1)  # [invalid-envvar-default]

Created by the stdlib checker.