fix UnicodeEncodeError when environment variables PYTHONUNBUFFERED=true