<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rmtree(path):
 """A version of rmtree that can deal with read-only files and directories. Needed because the stock shutil.rmtree() fails with an access error when there are read-only files in the directory on Windows, or when the directory itself is read-only on Unix. """

    def onerror(func, path, exc_info):
        # Did you know what on Python 3.3 on Windows os.remove() and
        # os.unlink() are distinct functions?
        if func is os.remove or func is os.unlink or func is os.rmdir:
            if sys.platform != 'win32':
                chmod_plus(os.path.dirname(path), stat.S_IWUSR | stat.S_IXUSR)
            chmod_plus(path)
            func(path)
        else:
            raise
    shutil.rmtree(path, onerror=onerror)