From bc69f689ab45146f6ebd97bd63f412eb48f116b8 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 17 May 2024 12:33:09 +0700 Subject: [PATCH] Fix Mnemosyne importer clobbering source file --- qt/aqt/import_export/importing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))