diff --git a/anki/importing/anki2.py b/anki/importing/anki2.py index c6a0143c2..0df5e39ab 100644 --- a/anki/importing/anki2.py +++ b/anki/importing/anki2.py @@ -323,7 +323,11 @@ insert or ignore into revlog values (?,?,?,?,?,?,?,?,?)""", revlog) def _writeDstMedia(self, fname, data): path = os.path.join(self.dst.media.dir(), fname) - open(path, "wb").write(data) + try: + open(path, "wb").write(data) + except (OSError, IOError): + # the user likely used subdirectories + pass def _mungeMedia(self, mid, fields): fields = splitFields(fields)