diff --git a/qt/aqt/import_export/importing.py b/qt/aqt/import_export/importing.py index 0719701da..05a37aece 100644 --- a/qt/aqt/import_export/importing.py +++ b/qt/aqt/import_export/importing.py @@ -96,7 +96,7 @@ class MnemosyneImporter(Importer): @staticmethod def do_import(mw: aqt.main.AnkiQt, path: str) -> None: def on_success(json: str) -> None: - json_path = os.path.join(tmpdir(), path) + json_path = os.path.join(tmpdir(), os.path.basename(path)) with open(json_path, "wb") as file: file.write(json.encode("utf8")) ImportDialog(mw, JsonFileArgs(path=json_path))