Genthus / Freqman

Anki addon to sort cards according to a frequency dictionary
MIT License
5 stars 0 forks source link

Dictionaries don't import #3

Closed cademcniven closed 1 year ago

cademcniven commented 1 year ago

I'm having the same issue the person on ankiweb is. I get an error whenever I try to import a dictionary (have tried multiple).

Here's the output from trying to import the jpdb list

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 to the add-on author.
Debug info:
Anki 2.1.55 (01caec2a) Python 3.9.15 Qt 6.4.0 PyQt 6.4.0
Platform: Windows-10-10.0.19045
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-01-09 19:10:55

Caught exception:
Traceback (most recent call last):
  File "C:\Users\eminent\AppData\Roaming\Anki2\addons21\1502429998\window.py", line 176, in importDict
    res = importYomichanFreqDict(self.dictPath.text())
  File "C:\Users\eminent\AppData\Roaming\Anki2\addons21\1502429998\db.py", line 137, in importYomichanFreqDict
    terms = json.load(f)
  File "json", line 293, in load
UnicodeDecodeError: 'cp932' codec can't decode byte 0x95 in position 45: illegal multibyte sequence

And here's the output from trying to import the narou list

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 to the add-on author.
Debug info:
Anki 2.1.55 (01caec2a) Python 3.9.15 Qt 6.4.0 PyQt 6.4.0
Platform: Windows-10-10.0.19045
Flags: frz=True ao=True sv=3
Add-ons, last update check: 2023-01-09 19:10:55

Caught exception:
Traceback (most recent call last):
  File "C:\Users\eminent\AppData\Roaming\Anki2\addons21\1502429998\window.py", line 176, in importDict
    res = importYomichanFreqDict(self.dictPath.text())
  File "C:\Users\eminent\AppData\Roaming\Anki2\addons21\1502429998\db.py", line 137, in importYomichanFreqDict
    terms = json.load(f)
  File "json", line 293, in load
UnicodeDecodeError: 'cp932' codec can't decode byte 0x8b in position 8: illegal multibyte sequence
Genthus commented 1 year ago

I just pushed v1.1.7, can you try updating the addon in anki and importing the zip file again?

cademcniven commented 1 year ago

So the good news is that v1.1.7 fixed this issue and dictionaries import correctly now!

The bad news is, reordering cards doesn't seem to do anything. I believe this is due to #2, as my note type name also contains spaces

Genthus commented 1 year ago

Thank you for letting me know! I'm updating to fix #2 as well in a bit.