env.py: Don't crash if encoding is not found from environment