code: def shutil_rmtree_onerror(func: Callable[[str], None],
                            path: str,
                            exc_info: EXC_INFO_TYPE) -> None:
        # noqa
      if not os.access(path, os.W_OK):
          # Is the error an access error ?
          os.chmod(path, stat.S_IWUSR)
          func(path)
      else:
          exc = exc_info[1]
          raise exc
docs: Error handler for ``shutil.rmtree``.
  
      If the error is due to an access error (read only file)
      it attempts to add write permission and then retries.
  
      If the error is for another reason it re-raises the error.
  
      Usage: ``shutil.rmtree(path, onerror=shutil_rmtree_onerror)``
      
      See
      https://stackoverflow.com/questions/2656322/shutil-rmtree-fails-on-windows-with-access-is-denied