Subject: | Illegal division by zero when fetching from AlphaVantage. |
Date: | Mon, 14 May 2018 09:59:22 +0200 |
To: | bug-Finance-Quote [...] rt.cpan.org |
From: | "Edward d'Auvergne" <true.bugman [...] gmail.com> |
Finance::Quote version: 1.47
Perl version: "This is perl 5, version 22, subversion 3 (v5.22.3)
built for x86_64-linux-thread-multi"
OS: Mageia 6 x86-64
I have reported this bug upstream for Mageia at:
https://bugs.mageia.org/show_bug.cgi?id=22834
And for Gnucash at:
https://bugzilla.gnome.org/show_bug.cgi?id=795564
Using the Gnucash quote fetching utility gnc-fq-dump (a wrapper for
F::Q), I see:
$ gnc-fq-dump currency USD XAU
1 USD = 0.00075451 XAU
$ gnc-fq-dump currency USD XAU
1 USD = 0.00075451 XAU
$ gnc-fq-dump currency USD XAU
Illegal division by zero at
/usr/lib/perl5/vendor_perl/5.22.3/Finance/Quote.pm line 289.
$ gnc-fq-dump currency USD CNY
1 USD = <unknown> CNY
$ gnc-fq-dump currency USD CNY
1 USD = <unknown> CNY
$ gnc-fq-dump currency USD CNY
1 USD = <unknown> CNY
$ gnc-fq-dump currency CNY
$ gnc-fq-dump currency CNY EUR
1 CNY = 0.12991535 EUR
$ gnc-fq-dump currency CNY USD
1 CNY = 0.15822534 USD
$ gnc-fq-dump currency USD CNY
1 USD = 6.3201 CNY
$
When fetching a large block of quotes at the same time, it appears as
if this NaN issue completely blocks F::Q. Anyway, I have been advised
to report this here.
Cheers,
Edward