diff --git a/pylib/anki/importing/mnemo.py b/pylib/anki/importing/mnemo.py
index 3ae882ca3..425813c37 100644
--- a/pylib/anki/importing/mnemo.py
+++ b/pylib/anki/importing/mnemo.py
@@ -3,6 +3,7 @@
import re
import time
+from typing import cast
from anki.db import DB
from anki.importing.noteimp import ForeignCard, ForeignNote, NoteImporter
@@ -160,17 +161,17 @@ acq_reps+ret_reps, lapses, card_type_id from cards"""
t = mm.newTemplate("Recognition")
t["qfmt"] = "{{Expression}}"
t["afmt"] = (
- t["qfmt"]
+ cast(str, t["qfmt"])
+ """\n\n
\n\n\
-{{Pronunciation}}
\n{{Meaning}}
\n{{Notes}}""" # type: ignore
+{{Pronunciation}}
\n{{Meaning}}
\n{{Notes}}"""
)
mm.addTemplate(m, t)
t = mm.newTemplate("Production")
t["qfmt"] = "{{Meaning}}"
t["afmt"] = (
- t["qfmt"]
+ cast(str, t["qfmt"])
+ """\n\n
\n\n\
-{{Expression}}
\n{{Pronunciation}}
\n{{Notes}}""" # type: ignore
+{{Expression}}
\n{{Pronunciation}}
\n{{Notes}}"""
)
mm.addTemplate(m, t)
mm.add(m)
diff --git a/pylib/anki/importing/pauker.py b/pylib/anki/importing/pauker.py
index e24238735..8850c6c2a 100644
--- a/pylib/anki/importing/pauker.py
+++ b/pylib/anki/importing/pauker.py
@@ -39,7 +39,7 @@ class PaukerImporter(NoteImporter):
try:
f = gzip.open(self.file)
- tree = ET.parse(f)
+ tree = ET.parse(f) # type: ignore
lesson = tree.getroot()
assert lesson.tag == "Lesson"
finally:
diff --git a/qt/aqt/importing.py b/qt/aqt/importing.py
index 257fd4bfe..4ae7ff80a 100644
--- a/qt/aqt/importing.py
+++ b/qt/aqt/importing.py
@@ -491,7 +491,7 @@ def _replaceWithApkg(mw, filename, backup):
with z.open(colname) as source, open(mw.pm.collectionPath(), "wb") as target:
# ignore appears related to https://github.com/python/typeshed/issues/4349
# see if can turn off once issue fix is merged in
- shutil.copyfileobj(source, target) # type: ignore
+ shutil.copyfileobj(source, target)
d = os.path.join(mw.pm.profileFolder(), "collection.media")
for n, (cStr, file) in enumerate(