Python Shutil复制WinError 2

问题描述

我在Windows 10上使用Python 3.7.3和shutil.copy将C:驱动器上的文件复制到共享驱动器上的目标。有时它虽然给了我WinError2,但输出却很奇怪。它说目标路径+源文件不存在,这没有任何意义。例如:

shutil.copy('C:\\source\\file\\path\\file.txt','S:\\destination\\directory')

将导致:

<class 'FileNotFoundError'>[WinError 2] The system cannot find the file specified: 'S:\\destination\\directory\\file.txt'<traceback object at 0x0FC462D8>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)