From 400571306a22e095199d7ce8f2318c8680c63277 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 17 May 2013 14:22:49 +0900 Subject: [PATCH] better warning when apkg invalid --- aqt/importing.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aqt/importing.py b/aqt/importing.py index 534efdf41..d62f0edc3 100644 --- a/aqt/importing.py +++ b/aqt/importing.py @@ -306,6 +306,13 @@ backup, please see the 'Backups' section of the user manual.""")) mw.progress.start(immediate=True) try: importer.run() + except zipfile.BadZipfile: + msg = _("""\ +This file does not appear to be a valid .apkg file. If you're getting this \ +error from a file downloaded from AnkiWeb, chances are that your download \ +failed. Please try again, and if the problem persists, please try again \ +with a different browser.""") + showWarning(msg) except Exception, e: if "invalidFile" in unicode(e): msg = _("""\