Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

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

Closed
52617365 opened this issue Jun 17, 2022 · 4 comments

Comments

@52617365
Copy link

52617365 commented Jun 17, 2022

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
Copy link
Contributor

A duplicate of #286, fixed in master.

@FooSoft I think the version on AnkiWeb is outdated?

@FooSoft
Copy link
Owner

FooSoft commented Jul 3, 2022

@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
Copy link
Contributor

@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:

  • For the old version, I put a maximum allowed patch version as a negative number, 2.1.0 to -48.
  • Then I saved the page.
  • After the page reloaded, there was a second “branch” box for the second version. There I uploaded the new version for Anki 2.1.49 to 53.

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
Copy link
Owner

FooSoft commented Jul 14, 2022

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

@FooSoft FooSoft closed this as completed Jul 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants