5
Vent: My first Python script deleted all my vacation photos
I was working on a script in my apartment in Portland to organize files by date, and I accidentally used shutil.rmtree() instead of shutil.copytree(). It wiped my entire 'Summer 2023' folder with over 200 pictures before I realized. I panicked and spent the next 3 hours learning about file recovery tools, and I actually got most of them back using a program called Recuva. Has anyone else had a coding mistake that caused real damage, and how did you fix it?
3 comments
Log in to join the discussion
Log In3 Comments
davis.noah1mo ago
Did you have backups turned on for that folder? Most cloud services like Google Photos or iCloud keep copies unless you specifically delete them there too. I've made similar mistakes with scripts, so now I always test them on dummy folders first. It's a painful way to learn, but it really sticks with you. Glad you got most of your photos back.
1
laura_black311mo ago
Yeah it's like we're all just one wrong click away from total chaos. I see this everywhere now, not just with tech. People get a little confident, skip the small safety steps, and then spend ten times longer fixing the mess. It's why I double check my address before ordering food online, or read a recipe twice before I start cooking. That moment of "I got this" is usually right before everything goes wrong.
4
the_angela1mo agoTop Commenter
Oh man, the "painful way to learn" part is too real. I once tried to clean up my downloads folder with a command and wiped my entire desktop instead (don't ask how I set that up, it was a dark time). You're totally right, davis.noah, about testing on dummy folders. I just get this excited feeling like "I am a genius who can automate my life" and then immediately prove myself wrong. It's a special talent, really.
1