johnpincock / SpecialFields

Anki Addon to protect certain fields from being overwritten by anki's import and export functions
GNU General Public License v3.0
7 stars 8 forks source link

Anki 2.1.24beta3 bug #16

Closed AnKingMed closed 4 years ago

AnKingMed commented 4 years ago

Tagging @Arthur-Milchior as well in case you have any thoughts on this

Import failed. Debugging info:
Traceback (most recent call last):
  File "aqt/importing.py", line 402, in on_done
  File "concurrent/futures/_base.py", line 432, in result
  File "concurrent/futures/_base.py", line 388, in __get_result
  File "concurrent/futures/thread.py", line 57, in run
  File "anki/importing/apkg.py", line 44, in run
  File "anki/importing/anki2.py", line 41, in run
  File "anki/importing/anki2.py", line 65, in _import
  File "anki/importing/anki2.py", line 340, in _importCards
  File "/Users/Nick/Library/Application Support/Anki2/addons21/1102281552/__init__.py", line 286, in _did
    self._did(idInSrc)
  File "/Users/Nick/Library/Application Support/Anki2/addons21/1102281552/__init__.py", line 298, in _did
    conf = self.src.decks.getConf(g["conf"])
  File "anki/decks.py", line 377, in getConf
  File "anki/rsbackend.py", line 497, in get_deck_config
TypeError: '1' has type str, but expected one of: int, long
Arthur-Milchior commented 4 years ago

Does the bug disappear if you try to import without the add-on ? I would not be surprised if it were not the case. In which case you'd have found a bug in anki. I will let you try before reporting it to dae or correcting it.

AnKingMed commented 4 years ago

You're right. I'll report it to dae. Thanks @Arthur-Milchior !

Arthur-Milchior commented 4 years ago

@dae: if you want to force rust' input id to be int/long, you should probably force the conversion of id to int before sending them to rust. At least in importer, where there is an higher probability of ids being string if at anypoint in time they were strins

dae commented 4 years ago

It was fixed in master about a week ago

Arthur-Milchior commented 4 years ago

Oh ok. I haven't check master. Sorry