I am trying to run a Python script on Jenkins, and I get that error: The file have all the rights, any suggestion ?
ERROR:root:[WinError 5] Access is denied: 'D:\\JDM_WS\\s_3yZW\\Folder\\file.xlsm'
Traceback (most recent call last):
File "C:\Users\MyUser\AppData\Local\Programs\Python\Python38\lib\shutil.py", line 788, in move
os.rename(src, real_dst)
PermissionError: [WinError 5] Access is denied: 'D:\\JDM_WS\\s_3yZW' -> 'D:\\JDM_WS\\w_3yZW\\Software'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\MyUser\AppData\Local\Jenkins\.jenkins\workspace\Jazz\Jobs\JazzJob\main.py", line 516, in main
restructure_folder(src=case_src,
File "C:\Users\MyUser\AppData\Local\Jenkins\.jenkins\workspace\Jazz\Jobs\JazzJob\main.py", line 176, in restructure_folder
shutil.move(src=src, dst=dst)
File "C:\Users\MyUser\AppData\Local\Programs\Python\Python38\lib\shutil.py", line 800, in move
rmtree(src)
File "C:\Users\MyUser\AppData\Local\Programs\Python\Python38\lib\shutil.py", line 737, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Users\MyUser\AppData\Local\Programs\Python\Python38\lib\shutil.py", line 610, in _rmtree_unsafe
_rmtree_unsafe(fullname, onerror)
File "C:\Users\MyUser\AppData\Local\Programs\Python\Python38\lib\shutil.py", line 615, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\MyUser\AppData\Local\Programs\Python\Python38\lib\shutil.py", line 613, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'D:\\JDM_WS\\s_3yZW\\Folder\\file.xlsm'