AvatarHurden / keypirinha-currency

A currency converter plugin for Keypirinha
MIT License
30 stars 4 forks source link

Errors printed #2

Closed polyvertex closed 6 years ago

polyvertex commented 6 years ago

Hi, with the v1.2 of the package, my Keypirinha console keep spitting the following:

** ERROR: Error from Currency.Currency.on_suggest: <class 'AttributeError'>: 'NoneType' object has no attribute 'validate_codes'
Traceback (most recent call last):
  File "D:\prog\apps\keypirinha\portable\Profile\InstalledPackages\Currency.keypirinha-package\currency.py", line 112, in on_suggest
  File "D:\prog\apps\keypirinha\portable\Profile\InstalledPackages\Currency.keypirinha-package\currency.py", line 205, in _parse_and_merge_input
AvatarHurden commented 6 years ago

This was an issue with the local rates file, and should be fixed in version 1.2.1.

If it happens again, please let me know and I'll reopen the issue.

polyvertex commented 6 years ago

Didn't occur so far since the update. Thanks!

markcs commented 6 years ago

Sorry to comment on a closed issued, but I'm seeing this same error with the latest update, but with different line numbers.

I'm not sure how to check the version, but it is the latest downloaded from github. Any ideas?

AvatarHurden commented 6 years ago

Could you add the console log when the error occurs? If it's the same bug, I'll reopen the issue, otherwise it would be better to open a new one.

markcs commented 6 years ago

@AvatarHurden these are the errors:

09:38:37.804 ** ERROR: Error from Currency.Currency.on_suggest: <class 'AttributeError'>: 'NoneType' object has no attribute 'validate_codes' Traceback (most recent call last): File "C:\Users\me\Programs\Keypirinha\portable\Profile\InstalledPackages\Currency.keypirinha-package\currency.py", line 105, in on_suggest File "C:\Users\me\Programs\Keypirinha\portable\Profile\InstalledPackages\Currency.keypirinha-package\currency.py", line 194, in _parse_and_merge_input

AvatarHurden commented 6 years ago

I'm not exactly sure what the issue is, but I added a new version fixing one bug that I found. Hopefully this fixes the problem.

Just out of curiosity, is there a "rates.json" file in your Local folder for the plugin and, if there is, could you attach it in another comment? I think the issues are coming from problems in this file, and another example could help me test this theory 😄

markcs commented 6 years ago

@AvatarHurden I do not have the rates.json file. I guess that is the problem....

EDIT: I killed and restarted keypirinha and the rates.json file was created. Now it is working. Not sure if that is a bug in the package or in keypirinha, but I guess I shouldn't have to restart the program for the rates to be downloaded?

polyvertex commented 6 years ago

In case it helps, after some tests I observed the same symptoms after deleting rates.json.

Also please take care of removing any debug printing before shipping your package, I have what seems to be the content of rates.json dumped to my console

AvatarHurden commented 6 years ago

Sorry about the dumps, I attached the wrong build to the release. It should be fixed now. 😅

I've made some tests on my end and now there doesn't seem to be an issue with neither a corrupt nor non-existing rates file. I'll reopen the issue for now in case it still appears, so please let me know if anything still goes wrong.

polyvertex commented 6 years ago

Seems ok after the update here, thanks!

mtaki14 commented 6 years ago

Getting "Error: 'NoneType' object has no attribute 'validate_codes'

15:22:48.662 ** ERROR: Error from Currency.Currency.on_suggest: <class 'AttributeError'>: 'NoneType' object has no attribute 'validate_codes' Traceback (most recent call last): File "C:\Users__\Keypirinha\portable\Profile\InstalledPackages\Currency.keypirinha-package\currency.py", line 105, in onsuggest File "C:\Users_\Keypirinha\portable\Profile\InstalledPackages\Currency.keypirinha-package\currency.py", line 194, in _parse_and_merge_input

AvatarHurden commented 6 years ago

Seems like the API I am using is returning an invalid JSON. Should be fixed in the latest release (1.2.3).