fix broken PYTHONENCODING/extend_env (thx David)