BlueGreenMagick / sync-excel-with-anki

Automatically syncs a batch of excel files with Anki
Other
18 stars 4 forks source link

Error Anki 2.1.24 #17

Open OQHan opened 3 years ago

OQHan commented 3 years ago

Error An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site. Debug info: Anki 2.1.24 (359b9f5c) Python 3.8.0 Qt 5.13.1 PyQt 5.14.1 Platform: Mac 10.15.7 Flags: frz=True ao=True sv=2 Add-ons, last update check: 2021-02-19 10:24:37 Add-ons possibly involved: ⁨Anki Excel Sync⁩

Caught exception: Traceback (most recent call last): File "/Users/oqhan/Library/Application Support/Anki2/addons21/1832015432/ankiExcelSync/menu.py", line 34, in confirm_e2a_sync ExcelSync().e2a_sync() File "/Users/oqhan/Library/Application Support/Anki2/addons21/1832015432/ankiExcelSync/sync.py", line 258, in e2a_sync self.backup_then_sync(self._e2a_sync) File "/Users/oqhan/Library/Application Support/Anki2/addons21/1832015432/ankiExcelSync/sync.py", line 255, in backup_then_sync mw.unloadCollection(on_unload) File "aqt/main.py", line 519, in unloadCollection File "aqt/main.py", line 783, in closeAllWindows File "aqt/init.py", line 107, in closeAll File "aqt/main.py", line 517, in callback File "/Users/oqhan/Library/Application Support/Anki2/addons21/1832015432/ankiExcelSync/sync.py", line 253, in on_unload syncfunc() File "/Users/oqhan/Library/Application Support/Anki2/addons21/1832015432/ankiExcelSync/sync.py", line 425, in _e2a_sync raise e File "/Users/oqhan/Library/Application Support/Anki2/addons21/1832015432/ankiExcelSync/sync.py", line 345, in _e2a_sync ) = self.compare_notes(files, super_tags) File "/Users/oqhan/Library/Application Support/Anki2/addons21/1832015432/ankiExcelSync/sync.py", line 279, in compare_notes dt = ef.read_file() File "/Users/oqhan/Library/Application Support/Anki2/addons21/1832015432/ankiExcelSync/excel.py", line 64, in read_file nid = row[len(model_fields) + 1].value IndexError: tuple index out of range

keithcdodd commented 3 years ago

I believe I get the same error for 2.1.35 . Would be amazing if fixed.

BlueGreenMagick commented 3 years ago

This error happens because atleast one of your excel files don't have enough columns. (Every excel file should atleast have number of note type fields + 2 columns) And the code assumed you have atleast that much columns.

I probably won't have time to fix this anytime soon, so you'll have to go through all the excel files and make sure they have enough number of columns.