<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def putenv(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.putenv(key, value)
        except OSError:
            # win + py3 raise here for invalid keys which is probably a bug.
            # ValueError seems better
            raise ValueError