diff --git a/anki/deck.py b/anki/deck.py index 3c685401a..4b12fa328 100644 --- a/anki/deck.py +++ b/anki/deck.py @@ -3353,6 +3353,11 @@ nextFactor, reps, thinkingTime, yesCount, noCount from reviewHistory""") path = path.replace(":", "") return path escp = escape(path) + # make sure backup dir exists + try: + os.makedirs(backupDir) + except (OSError, IOError): + pass # find existing backups gen = re.sub("\.anki$", ".backup-(\d+).anki", re.escape(escp)) backups = []