eshapard / AnkiHabitica

Anki 2.0/2.1 add-on for use with HabitRPG. Automatically scores habits when you reach the end of your Anki timebox and when you review all cards in a deck.
GNU General Public License v3.0
197 stars 31 forks source link

Errors #44

Closed hdgogo11 closed 6 years ago

hdgogo11 commented 7 years ago

Hi there,

I installed AnkiHabitica the same way I installed other add-ons, however there is no "Anki Points" in my Habitica and an error window pops up every time I open Anki and while using.

"Unhandled exception in thread started by <bound method Habitica.save_avatar of <AnkiHabitica.habitica_class.Habitica object at 0x150b2e30>> Traceback (most recent call last): File "/Users/nantan/Library/Application Support/Anki2/addons/AnkiHabitica/habitica_class.py", line 89, in save_avatar self.avatarfile = self.avatarfile.decode(sys.getfilesystemencoding()) File "encodings/utf_8.pyc", line 16, in decode UnicodeEncodeError: 'ascii' codec can't encode characters in position 68-69: ordinal not in range(128)"

eshapard commented 7 years ago

This looks like it may be an issue with your Anki username. Is it something other than 'User 1'?

We seem to have fixed some issues with unicode characters in the username, but there are still problems with this. Have you tried downloading the version posted on github? If that doesn't work, the work-around may be to rename your anki user profile to something with only ascii characters.

eshapard commented 7 years ago

This may be due to a mismatch between the username encoding and the filesystem encoding... I might be able to fix this with a different naming scheme for the avatar image file... will have to think about this.

eshapard commented 7 years ago

I made some changes to the version on github. Hopefully, this will fix the problem.

The addon had trouble saving the avatar image using Chinese characters, so I changed it to use the habitica user ID instead of the profile name.