FooSoft / anki-connect

Anki plugin to expose a remote API for creating flash cards.
https://foosoft.net/projects/anki-connect/
Other
1.94k stars 219 forks source link

"rem() takes 2 positional arguments but 3 were given" when using the correct body. #335

Closed 52617365 closed 2 years ago

52617365 commented 2 years ago

I'm making a Neovim plugin that lets you do the Anki stuff from inside of Neovim and I ran into a problem when trying to delete decks from Anki.

My post request body looks like this:

{"version": 6, "action": "deleteDecks", "params": {"cardsToo": true, "decks": ["asd"]}}

The response looks like this: {"result": null, "error": "rem() takes 2 positional arguments but 3 were given"}

It seems to me that the body is indeed correct and that there is probably something wrong with the API itself. Also tried the same in curl and it did not work.

oakkitten commented 2 years ago

A duplicate of #286, fixed in master.

@FooSoft I think the version on AnkiWeb is outdated?

FooSoft commented 2 years ago

@oakkitten so funny story. I'm still trying to figure out how the hell to update the plugin for a range of versions on AnkiWeb. I'm not seeing a way to make it so that specific versions of Anki get specific versions of the plugin :|

oakkitten commented 2 years ago

@FooSoft I think I figured it out. First of all note how Anki-Connect version box is yellow. I recently updated an add-on of my own, note how the version box is blue, and it shows two version ranges.

So what I did was, if I recall it right:

During any of that I didn't touch the “Choose File” button for the first branch.

image

I think this is correct?

P.S. I asked on the support forum and the branches apparently can't overlap, so something like 2.1.0 to -54 and 2.1.49 to 54 is not possible.

FooSoft commented 2 years ago

Thanks @oakkitten , I finally got it working and pushed out a release of the latest and greatest.