在Python中从临时互联网缓存复制文件

发布于 2024-11-14 03:54:26 字数 379 浏览 8 评论 0原文

我正在使用 python 脚本将文件从临时 Internet 文件缓存复制到文件夹中。使用shutil复制os.cwd的完整路径,会出现以下错误:

builtins.IOError: [Errno 22] Invalid argument:  
'C:\\Users\\NICK\\AppData\\(no whitespace in path; only for readability)
Local\\Microsoft\\Windows\\(no whitespace in path; only for readability)
Temporary Internet Files\\CONTENT.IE5\\04HT8Z5C\\024MS[1].png\\'

是因为这些文件被隐藏还是什么原因?

I'm copying files from the temporary internet files cache into a folder, in bulk using a python script. Using shutil to copy the full path to the os.cwd, it comes up with this error:

builtins.IOError: [Errno 22] Invalid argument:  
'C:\\Users\\NICK\\AppData\\(no whitespace in path; only for readability)
Local\\Microsoft\\Windows\\(no whitespace in path; only for readability)
Temporary Internet Files\\CONTENT.IE5\\04HT8Z5C\\024MS[1].png\\'

Is it because these files are hidden or something?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叫思念不要吵 2024-11-21 03:54:26

文件名末尾有一个反斜杠,因此它可能被视为路径。

There is a backslash at the end of your file name so it is maybe treated as a path.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文