eshapard / AnkiHabitica

Anki 2.0/2.1 add-on for use with HabitRPG. Automatically scores habits when you reach the end of your Anki timebox and when you review all cards in a deck.
GNU General Public License v3.0
197 stars 31 forks source link

Logging file access errors #18

Closed eshapard closed 5 years ago

eshapard commented 8 years ago

I've gotten this a few times:

Traceback (most recent call last): File "C:\Users\vateacher\Documents\Anki\addons\AnkiHabitica\logging\handlers.py", line 78, in emit self.doRollover() File "C:\Users\vateacher\Documents\Anki\addons\AnkiHabitica\logging\handlers.py", line 144, in doRollover os.rename(self.baseFilename, dfn) WindowsError: [Error 32] The process cannot access the file because it is being used by another process Logged from file db_helper.py, line 119

I have the daily extra installed as well... could be specific to windows.

eshapard commented 8 years ago

Making logging optional in the daily habit extra and disabling it to see if it is causing the problem...

eshapard commented 8 years ago

Still having his error, so I updated my copy to include a Boolean variable to turn logging on/off. Will push changes to github later.

Logging doesn't really benefit the average end-user anyway... unless they want to report a bug. So we can make logging disabled by default and tell users to turn it on if we need it.

Ultimately, the fix may be to alter the logging functions to wait a few seconds after getting this error and try again.