Closed NiklasAurora closed 2 weeks ago
submitted PR #50 which fixes this
I would say it fixes some of the problems, but I think marvin will still crash (or at least leak resources) if we get an IOError for any reason that is not fixed by opening the file again in write mode.
good point, and as you wrote in the irc chat about switching to storing it in memory and not saying good morning the first day is probably the most practical solution. I'll re-write it and submit a new PR
https://github.com/mosbth/irc2phpbb/blob/be7ec4754161243143e67fbf370bdc1d96d09f79/marvin_general_actions.py#L81-L90
This code should be rewritten to either use WITH or to close the file after use.
Another solution is to have the date loaded in memory since Marvin is always running, however, this means he could says good morning twice on the days he's restarted or crashes.