Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invest-applet: mate-applets: quotes.py:222:parse_yahoo_csv:IndexError: list index out of range #119

Closed
raveit65 opened this issue Dec 31, 2014 · 8 comments

Comments

@raveit65
Copy link
Member

fedora report:
https://bugzilla.redhat.com/show_bug.cgi?id=1159061

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/mate_invest/quotes.py", line 184, in on_currency_retriever_completed
    self.convert_currencies(self.parse_yahoo_csv(csv.reader(retriever.data)))
  File "/usr/lib/python2.7/site-packages/mate_invest/quotes.py", line 224, in parse_yahoo_csv
    result[fields[0]][field] = fields[i]
IndexError: list index out of range

I could track down the issue, it occours when switching to another currency then USD.
Here is the complete debug output when i switched to euro, british pound or fidiji dollar.
And the applet doesn't switch to any other currency than US dollar here.
https://dl.dropboxusercontent.com/u/49862637/Mate-desktop/Bugs/mate-invest-applet
Note: powering off networking didn't occours any issue.

@infirit
Copy link
Contributor

infirit commented Dec 31, 2014

I can reproduce it now. The trick is to keep the charts popup open and then change the currency.

@raveit65
Copy link
Member Author

hmm, closing the preferences window for apply the currency change close also the popup window here.

@infirit
Copy link
Contributor

infirit commented Jan 4, 2015

Can you try https://github.com/infirit/mate-applets/commit/fc44b71b9d02c58ca0109ee2f0a8fdbbcba8c526 and confirm it fixes this problem?

@infirit infirit closed this as completed in 14ad0b4 Jan 4, 2015
@infirit
Copy link
Contributor

infirit commented Jan 4, 2015

I just committed the correct fix for this problem in 14ad0b4.

@raveit65
Copy link
Member Author

raveit65 commented Jan 5, 2015

@infirit Thank you... great job
Changing the currency works well now and the traceback is gone :)
But i see another gtk-critical warning now, and it seems that invest applet ships some currencies which doesn't exists.

2015-01-05 17:03:58.447730: ['CON', 'CON', '|v\r', '0.00', 'N/A', '9:-336am', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A']
2015-01-05 17:03:58.447830: 11
' is not known, dropping53: Currency '|V
2015-01-05 17:03:58.451314: Currency '���' is not known, dropping
2015-01-05 17:03:58.452246: Currency 'HGV' is not known, dropping
2015-01-05 17:03:58.453930: Currency '���' is not known, dropping
2015-01-05 17:03:58.456393: Currency '���' is not known, dropping
2015-01-05 17:03:58.458052: Currency '���' is not known, dropping
2015-01-05 17:03:58.458896: Currency 'HGV' is not known, dropping
2015-01-05 17:03:58.461398: Currency '���' is not known, dropping
2015-01-05 17:03:58.462246: Currency '���' is not known, dropping
2015-01-05 17:03:58.463081: Currency '���' is not known, dropping
2015-01-05 17:03:58.464196: These currencies occur: ['USD']
2015-01-05 17:03:58.464240: USD will be converted to EUR
2015-01-05 17:03:58.464355: QuotesRetriever created
2015-01-05 17:03:58.464492: QuotesRetriever started
2015-01-05 17:03:58.909500: CurrencyRetriever completed
2015-01-05 17:03:58.909606: Storing currencies to /home/rave/.config/mate/invest-applet/currencies.csv
2015-01-05 17:03:58.909798: Loading currencies from /home/rave/.config/mate/invest-applet/currencies.csv
2015-01-05 17:03:58.909888: ['USDEUR=X', 'USD to EUR', 'EUR', '0.838', '1/5/2015', '11:03am', 'N/A', 'N/A', 'N/A', 'N/A', 'N/A']
2015-01-05 17:03:58.909944: 11

(invest-applet:24046): Gtk-CRITICAL **: IA__gtk_list_store_set_value: assertion 'VALID_ITER (iter, list_store)' failed
2015-01-05 17:06:42.024807: Stocks written to file
2015-01-05 17:06:42.024944: Configuration written to file
2015-01-05 17:06:42.025681: Setting refresh timer to 15:00.000
2015-01-05 17:06:42.025810: Loading quotes

........and i'm happy to see the 'deutsche Mark' ....smilyglasses
Can we merge this to 1.8 branch?

@infirit
Copy link
Contributor

infirit commented Jan 5, 2015

On the dropping of the currencies; The comment above this check does mention sometime seeing bad currency data.

sometimes, funny currencies are returned (special characters), only consider known currencies

And looking at |v\r I see why this check is done. However I do think there is some encoding problem (the question marks) and perhaps we need to update the list of currencies with at least HGV.

Can you open a new issue for this and add all the stock symbols and currency you are using?

I am not seeing the gtk critical and I hope this shows up with your setup.

@raveit65
Copy link
Member Author

raveit65 commented Jan 5, 2015

shure, i will open a new report.
I think the questions marks comes from missing language packages maybe.
Normaly, i uninstall packages which i don't need.
I hope the gtk critical comes not from my setup ;)
It was a test in fedora 20, i will check this for other fedora versions.
In which file the currencies are listed?

@raveit65
Copy link
Member Author

raveit65 commented Jan 6, 2015

After i use SAP.DE instead of SAP for a german stock symbol, the warnings about 'unknown currencies' are gone.
Also the 'gtk critical' one i see very seldom.
So for me this one is fixed, no need of further investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants