From b1d3637557fc622d199e4aceb43eea9080859c37 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 18 May 2012 06:09:59 +0900 Subject: [PATCH] catch read-only error --- aqt/importing.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aqt/importing.py b/aqt/importing.py index db16ac501..73ee32a6e 100644 --- a/aqt/importing.py +++ b/aqt/importing.py @@ -299,6 +299,9 @@ def onImport(mw): if "invalidFile" in unicode(e): showWarning(_("""\ Invalid file. Please run a DB check in Anki 1.2 and try again.""")) + elif "readonly" in unicode(e): + showWarning(_("""\ +Unable to import from a read-only file.""")) else: msg = _("Import failed.\n") msg += unicode(traceback.format_exc(), "ascii", "replace")