Derived from the flake8-bugbear linter.
What it does#
Checks for assignments to
Why is this bad?#
os.environ is a mapping that represents the environment of the
However, reassigning to
os.environ does not clear the environment. Instead,
it merely updates the
os.environ for the current process. This can lead to
unexpected behavior, especially when running the program in a subprocess.
os.environ.clear() to clear the environment, or use the
env argument of
subprocess.Popen to pass a custom environment to