shutil.move 无法在不同驱动器之间移动

huangapple go评论85阅读模式
英文:

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'

shutil.move 无法在不同驱动器之间移动

shutil.move 无法在不同驱动器之间移动

英文:

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'

shutil.move 无法在不同驱动器之间移动

shutil.move 无法在不同驱动器之间移动

答案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.

huangapple
  • 本文由 发表于 2020年1月3日 23:56:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/59581568.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定