I have a function where I am trying to rename a geodatabase, both os.rename and arcpy.Rename_management() work in the Python window but not in the Script when run as a tool through ArcCatalog.
Traceback (most recent call last): File "C:\PecosFieldTools\ProTools_v1.2\PhaseDeliverables\phase.py", line 562, in <module> arcpy.Rename_management(in_data=newGdb, out_data=phaseGdb, data_type="Workspace") File "c:\program files (x86)\arcgis\desktop10.6\arcpy\arcpy\management.py", line 4528, in Rename raise e ExecuteError: ERROR 999999: Error executing function. Failed to execute (Rename). Failed to execute (Phase)
I think this may be a permission issue but I am admin running this on my own machine. When I wrap in try and except I get these error
[Errno 13] Permission denied: u'C:\\\\Projects\\\\PhaseMasters\\\\HasData\\\\1810227C\\\\Master\\\\PHASE_DELIVERABLES\\\\DB13635_AF2136641_AP_00_X04.gdb\\\\EQ_AIR_COOLED_EXCHANGER_POLY.LAPTOP-3B9ORV48.16500.16420.sr.lock'")
But when I open the file geodatabase I do not see any locks and I am deleting all my cursors. Is there a way to await the locks to be removed with Python?