Select to view content in your preferred language

OSError: [Errno 16] Device or resource busy

509
0
a month ago
RogerAsbury
Frequent Contributor

Not sure if this is the right board to post this, if not, please advise...

I have a notebook on ArcGIS Online that I have scheduled to run daily. 90% of the time it works, but sometimes it errors out with the error in the title:
Screenshot_4-9-2025_15234_fnsb.maps.arcgis.com.jpegJust curious what causes this and any tips to avoid it.

Edit - Narrowed this down to a delete function listed below. But again, most of the time this works. Only rarely does it throw the above error:

def delete():
    for f in os.listdir(directory):
        if ".snapshot" not in f and ".tasks" not in f:
            if os.path.isfile(os.path.join(directory, f)):
                os.remove(os.path.join(directory, f))
            elif os.path.isdir(os.path.join(directory, f)):
                shutil.rmtree(os.path.join(directory, f))
    # Delete Temporary items
    for i in folder.list():
        if i.title == "temp" and i.type == "CSV":
            i.delete()
--
Roger Asbury
Analyst/Programmer - Fairbanks North Star Borough
0 Kudos
0 Replies