英文:
shutil.move cannot move between drives
问题
I am trying to move files to a mapped network drive that I have permissions for.
But it does not work. There have been other posts with this issue, but none of them have an answer. Anybody know what the deal is?
File "C:\Program Files (x86)\Python37-32\lib\shutil.py", line 557, in move
os.rename(src, real_dst)
OSError: [WinError 17] The system cannot move the file to a different disk drive: 'C:\\Users\\opcon\\pyscripts\\crif\9049_24360_20200102223356_.csv' -> 'G:\\b_129049_24360_20200102223356_.csv'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/opcon/pyscripts/fix_and_scan_crifloans.py", line 379, in fix_crifloan_csvs_exe
shutil.move(local_full_file_name, full_file_name_b)
File "C:\Program Files (x86)\Python37-32\lib\shutil.py", line 571, in move
copy_function(src, real_dst)
File "C:\Program Files (x86)\Python37-32\lib\shutil.py", line 257, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "C:\Program Files (x86)\Python37-32\lib\shutil.py", line 121, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'G:\\b_129049_24360_20200102223356_.csv'
英文:
I am trying to move files to a mapped network drive that I have permissions for.
But it does not work. There have been other posts with this issue, but none of them have an answer. Anybody know what the deal is?
File "C:\Program Files (x86)\Python37-32\lib\shutil.py", line 557, in move
os.rename(src, real_dst)
OSError: [WinError 17] The system cannot move the file to a different disk drive: 'C:\\Users\\opcon\\pyscripts\\crif\9049_24360_20200102223356_.csv' -> 'G:\\b_129049_24360_20200102223356_.csv'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/opcon/pyscripts/fix_and_scan_crifloans.py", line 379, in fix_crifloan_csvs_exe
shutil.move(local_full_file_name, full_file_name_b)
File "C:\Program Files (x86)\Python37-32\lib\shutil.py", line 571, in move
copy_function(src, real_dst)
File "C:\Program Files (x86)\Python37-32\lib\shutil.py", line 257, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "C:\Program Files (x86)\Python37-32\lib\shutil.py", line 121, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'G:\\b_129049_24360_20200102223356_.csv'
答案1
得分: 1
这实际上是我的Windows权限问题,这只是不立即显而易见,因为Windows说我应该有权限。
英文:
This is actually an issue with my Windows Permissions, this just was not immediately evident as windows says I should have permissions.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论