-
Notifications
You must be signed in to change notification settings - Fork 218
<class 'TypeError'>: Object of type 'map' is not JSON serializable #85
Comments
So it looks like AnkiConnect is getting passed some request that is causing it to generate a response which cannot be serialized to JSON. From the call stack it's kind of hard to figure out what's going on (since the actual handler is not displayed). Would mind running a modified AnkiConnect plugin to help troubleshoot this issue? |
Thank you very much for the quick answer to such an incomplete error report. I'll try my best to help. Where do you I find the modfified version? |
Hey, so I just added a basic API logging feature and uploaded a new version of AnkiConnect it to AnkiWeb (you can update the plugin from there). If you open the AnkiConnect.py`, near the top you will find this line:
If you change that to have a file path in there (in quotes), all of the transactions between emacs and Anki should be logged in there. So for instance you could do something like:
If you post the contents of that text file into this issue, it should hopefully provide enough context about what is going on to fix this problem 👍 |
Thanks again for your help. I tried but failed. I only get an empty file that has the name I set for the variable API_LOG_PATH (I just copied the code you posted). I used I still get the error report I reported in the initial post. Don't put too much trust into my reports. I'm afraid my motivation is higher than my knowledge. But I'm open to any new tasks ... |
I guess I should have mentioned that after you set the log file path, you should perform the action that causes AnkiConnect to misbehave. Nothing will be logged if you just run Anki and don't actually use AnkiConnect to talk with an external program : ) |
Thanks your time. I think I did what you asked for: I sent notes to AnkiConnect from this external application but didn't get a log. To make sure that logging works or I don't make a mistake I just tried a different software that talks to AnkiConnect. Still I can't get a log reliably. I used the Chrome Extension Anki Quick Adder Once I got a log for the chrome extension (and I think with exactly the same procedure). But I don't know what I did differently than in the run I've shown and I can't replicate it. Did I do something wrong? |
Thanks for the vid and sorry about the slow reply -- has been a hectic week. Since it looks like you are running on Debian (Linux makes everything easier), you can just change the |
I think a reply within one week for an open source project that you do in your free time is very good. I experimented today, this time with a virtual machine that contains ubuntu mate 18.04. I can't get ankiconnect to write into a file or to stdout. I replaced self.log.write(...) with print(...) but didn't get anything. the most obvious thing these two cases have in common is the user. So I guess that I make some kind of mistake or have some misconfiguration that I'm not aware of. 2.0.52 works so I'm in a very good position. Maybe the most efficient thing is to just wait and hope that some future version (for whatever reasons) just works. If you feel that I can do something let me know but I'm afraid that I'm just wasting your time. Again thank you very much for your great software and extensive help. |
I suppose it's introduced by 7a0b4e6, which replaces for loop with |
I tried with beta 42 and the latest AnkiConnect from 2018-06-24. This is the only addon installed. I don't call AnkiConnect directly but from within an emacs package that's called anki-editor. This package allows to send/push notes to AnkiConnect. When I run the "push" command in this package I get the following error message in Anki.
This emacs package works fine with AnkiConnect in 2.0.52. So I assume that the problem is not with this emacs-package? I don't know about the internals of emacs/elisp so I can't tell you what exactly is sent to AnkiConnect. Nevertheless I decided to post because this error message might still be useful for you ? If you feel that a novice like me can help with further information just give me instructions on what to do.
Anyway thanks for your great software.
The text was updated successfully, but these errors were encountered: