I have an existing script that copies a geodatabase to another location and renames it. It uses arcpy and os libraries to do it.
copy_from = r"C:\test.gdb" copy_to = r"D:\test.gdb" rename_to = r"D:\test_renamed.gdb" arcpy.env.overwriteoutput = True arcpy.Copy_management(copy_from, copy_to) os.rename(copy_to, rename_to) However, while renaming I am getting PermissionError: [WinError 5] Access is denied. I have verified that the user running the script has full access. I am able to temporarily fix the issue by using os.copytree instead of the arcpy function but I don't know why it is giving that error.
I have tried running Copy_management(copy_from, rename_to) as well but that gives a 000260: Failed to copy error.
EDIT:
System Specifications
Hardware - Intel Xeon 6248R, 128 GB RAM
OS - Windows Server 2019
Python Version - 2.7.18