简体   繁体   中英

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\\129049_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'

看起来我应该可以访问

但显然我无权访问

这实际上是我的 Windows 权限的一个问题,这并没有立即明显,因为 Windows 说我应该拥有权限。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM