def METHOD_NAME(key, value):
    """Like `os.putenv` but takes unicode under Windows + Python 2
    Args:
        key (pathlike): The env var to get
        value (pathlike): The value to set
    Raises:
        ValueError
    """
    key = path2fsn(key)
    value = path2fsn(value)
    if is_win and PY2:
        try:
            set_windows_env_var(key, value)
        except WindowsError:
            # py3 + win fails here
            raise ValueError
    else:
        try:
            os.METHOD_NAME(key, value)
        except OSError:
            # win + py3 raise here for invalid keys which is probably a bug.
            # ValueError seems better
            raise ValueError