error says \\\\Ref\\builds/out exists but it doesnt exist

前端 未结 1 887
野的像风
野的像风 2021-01-28 00:36

I am trying to copy a source code tree using the below code and running into an error,am not sure why I am getting this?error says \\\\Ref\\builds/out exists but it doesnt exist

1条回答
  •  遥遥无期
    2021-01-28 00:39

    The documentation for shutil.copytree clearly says:

    The destination directory, named by dst, must not already exist; it will be created as well as missing parent directories.

    But \\ref\builds\out already exists—you can see from the exception's stack trace that it's trying to mkdir that path, but that's failing with an error indicating that that path already exists (which can happen when the path exists as either a regular file or a directory).

    You need to copy to path that doesn't already exist, by either choosing a different path, or by deleting the existing tree at that location first. The latter can be done with shutil.rmtree.

    0 讨论(0)
提交回复
热议问题