pylint-errors

W1507 (shallow-copy-environ)

:x: Problematic code:

import copy
import os

envs = copy.copy(os.environ)

:heavy_check_mark: Correct code:

import os

envs = os.environ.copy()

Rationale:

os.environ is not a dict object but proxy object, so shallow copy has still effects on original object. See https://bugs.python.org/issue15373 for reference.