当我以admin的身份在cmd中运行这个脚本时,我得到了这个错误。当我在PowerShell中对同一组文件运行相同的脚本时,它可以正常工作,没有错误。失败的文件没有非法字符。在
C:\Windows\system32>python D:\Syncback\OurDocs\Darrick\MyPrograms\dbhf.py "C:\Us
ers\Darrick\Dropbox\Camera Uploads" "F:\Pictures\AndroidPics\Auto\"
looking for old files...
2015-06-05 15.33.18.jpg
moving C:\Users\Darrick\Dropbox\Camera Uploads\2015-06-05 15.33.18.jpg
Traceback (most recent call last):
File "D:\Syncback\OurDocs\Darrick\MyPrograms\dbhf.py", line 29, in <module>
shutil.move(filepath, destPath)
File "C:\Python27\lib\shutil.py", line 299, in move
copy2(src, real_dst)
File "C:\Python27\lib\shutil.py", line 128, in copy2
copyfile(src, dst)
File "C:\Python27\lib\shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 22] invalid mode ('wb') or filename: 'F:\\Pictures\\AndroidPics\
\Auto"'
脚本非常简单:
^{pr2}$
您需要在
destPath
后面附加文件的原始名称相关问题 更多 >
编程相关推荐