In Python 2, os.environ is a map with str keys and str values, not unicode. Unfortunately, values loaded with Python-dotenv are unicode.
Example with test.py:
import os
import dotenv
dotenv.load_dotenv()
print(type(os.environ["foo"]))
and .env:
Results:
> python test.py
<type 'unicode'>
> env foo=bar python test.py
<type 'str'>
I think that it's probably not worth fixing given Python 2's upcoming end of life, but I'm pointing this out here because this might justify turning off some Mypy type warnings for Python 2.