I am having a major problem preventing me from running a python 3x script. I am iterating over dozens of folders and creating lots of temporary data on each iteration. I am creating a temp gdb to store the temp data, then deleting and creating a new one on each pass. I have done this before with no issue, but now, after the first iteration I am getting a lock error Cannot delete C:/WebDev/Projects/...\temp.gdb. May be locked by another application. I want to emphasize that nothing is open, all programs including ArcPro have been closed before running the script and the error persists. I know this is a common issue and am hoping that someone can please give me a work-around. I have also tried just overwriting the gdb, but cannot do that either.
I have found this statement in the esri documentation regarding schema locks:
"Scripts may always update the schema of data created by tools within the same script, even if the current workspace is being used by another application."
If I understand this correctly, as long as the data being created from within the script (including the temp gdb) I should not be getting a lock error when attempting the delete it.
Can anyone please shed some light on this?
Thanks!