Convert env to byte dictionary on Python 2.