I have a flask app that writes to a .txt file to keep track of blacklisted IPs. It works most of the time, but occasionally I get an error, "OSError: write error"
My confusion here is, the exact same code never has this issue on replit or when hosted locally, the issue seems to be exclusive to pythonanywhere. For now I've resolved it by adding error handling and having it retry if it fails, works fine, but why am I getting write errors with pythonanywhere in the first place?
(Extra note: I always close my files at the end of each function and I tested to see if it was crossover, but even when I que writing to the file to ensure there is no possible crossover, the error still occurs. Also, I know I could also switch to using SQL to store the IPs but I want to figure out what's going on here regardless.)