KMyMoney and Finance::Quote

Thomas Baumgart thb at net-bembel.de
Sun Aug 7 08:47:41 BST 2022


Hi Andre,

On Samstag, 6. August 2022 17:13:20 CEST Andre Joost via KMyMoney wrote:

> 
> Hi Thomas,
> 
> thanks for taking up the issue.
> 
> Am 06.08.22 um 15:55 schrieb Thomas Baumgart via KMyMoney:
> 
> >
> > Some parts may have been changed due to a GSoC project last year. So
> > I am not sure. For some reason, I cannot run the perl script. Update:
> > well after some tweaking (removing some local leftovers from a
> > manually installed F::Q version) I am now able to retrieve the list
> > of sources with
> >
> > perl /usr/share/kmymoney/misc/financequote.pl -l
> >
> > and the combo box in KMyMoney fills with the translated names of the
> > sources when I turn on the "Use Finance::Quote" checkbox with the
> > security.
> >
> > I cannot retrieve any quotes though, because I get the following
> > error:
> >
> > kmymoney_webpricequote: quotedata "Can't locate Mozilla/CA.pm in @INC
> > (you may need to install the Mozilla::CA module) (@INC contains:
> > /usr/lib/perl5/site_perl/5.26.1/x86_64-linux-thread-multi
> > /usr/lib/perl5/site_perl/5.26.1
> > /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi
> > /usr/lib/perl5/vendor_perl/5.26.1
> > /usr/lib/perl5/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/5.26.1
> > /usr/lib/perl5/site_perl) at
> > /usr/lib/perl5/vendor_perl/5.26.1/Finance/Quote/Tiaacref.pm line
> > 33.\nCompilation failed in require at (eval 297) line 1.\nBEGIN
> > failed--compilation aborted at (eval 297) line 1.\n at
> > /usr/share/kmymoney/misc/financequote.pl line 56.\nError 2"
> >
> > kmymoney_webpricequote: stripped text "Can't locate Mozilla/CA.pm in
> > @INC (you may need to install the Mozilla::CA module) (@INC contains:
> > /usr/lib/perl5/site_perl/5.26.1/x86_64-linux-thread-multi
> > /usr/lib/perl5/site_perl/5.26.1
> > /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi
> > /usr/lib/perl5/vendor_perl/5.26.1
> > /usr/lib/perl5/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/5.26.1
> > /usr/lib/perl5/site_perl) at
> > /usr/lib/perl5/vendor_perl/5.26.1/Finance/Quote/Tiaacref.pm line 33.
> > Compilation failed in require at (eval 297) line 1. BEGIN
> > failed--compilation aborted at (eval 297) line 1. at
> > /usr/share/kmymoney/misc/financequote.pl line 56. Error 2"
> >
> > when running KMyMoney inside a terminal window. I see the same
> > message when running
> >
> > perl /usr/share/kmymoney/misc/financequote.pl unionfunds
> > US7565771026
> >
> > I am not a perl expert and don't see the necessary package on my
> > openSUSE Leap 15.4 which brings the missing Mozilla/CA.pm module. The
> > ISIN is that of RedHat in case you wonder.
> >
> > @Andre: can you provide the output of the above command so that I can
> > probably bypass my local problem and see why KMyMoney has a problem
> > with it?
> >
> >
> 
> 
> Using your cammand line on Linux and the original Union.pm, I get "error
> 2", because unionfunds only has their own funds listed, and not RedHat
> shares.
> 
> However, Mozilla:CA.pm is present with me.
> 
> After installing the latest files of Finance:Quote, I got similar error
> messages. So I have started
> cpan install finance::Quote
> to get it the regular way, and that installed all dependencies from
> third-party modules. That took quite some time (about an hour), but no
> missing modules anymore.

I try to keep my system as close to the pristine version provided by
the distro packager, so I won't start that route just now. 

> 
> Enabling the dump print in financequote.pl, I get this output on Windows:
> 
> D:\jo\Finanz\perl>perl D:\jo\Finanz\perl\financequote.pl unionfunds
> DE0008491002
> 
>          finding price for <DE0008491002> from <unionfunds>
> $VAR1 = 'DE0008491002?name';

[ ... ]

I used your output and took it as return value from the script by simply
replacing the returned error message about Mozilla::CA with your output
(all of it, as it receives stdout and stderr). So here's what I see
on the command line on linux:

kmymoney_webpricequote: quotedata "Can't locate Mozilla/CA.pm in @INC (you may need to install the Mozilla::CA module) (@INC contains: /usr/lib/perl5/site_perl/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.26.1 /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.26.1 /usr/lib/perl5/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/5.26.1 /usr/lib/perl5/site_perl) at /usr/lib/perl5/vendor_perl/5.26.1/Finance/Quote/Tiaacref.pm line 33.\nCompilation failed in require at (eval 297) line 1.\nBEGIN failed--compilation aborted at (eval 297) line 1.\n at /usr/share/kmymoney/misc/financequote.pl line 56.\nError 2"
kmymoney_webpricequote: stripped text "DE0008491002 finding price for from $VAR1 = 'DE0008491002?name'; $VAR2 = 'UniFonds'; $VAR3 = 'DE0008491002?success'; $VAR4 = 1; $VAR5 = 'DE0008491002?last'; $VAR6 = '52.14'; $VAR7 = 'DE0008491002?isodate'; $VAR8 = '2022-08-04'; $VAR9 = 'DE0008491002?exchange'; $VAR10 = 'UNION'; $VAR11 = 'DE0008491002?currency'; $VAR12 = 'EUR'; $VAR13 = 'DE0008491002?symbol'; $VAR14 = 'DE0008491002'; $VAR15 = 'DE0008491002?price'; $VAR16 = '52.14'; $VAR17 = 'DE0008491002?method'; $VAR18 = 'unionfunds'; $VAR19 = 'DE0008491002?date'; $VAR20 = '08/04/2022'; \"DE0008491002\",\"2022-008-004\",\"52.14\""
kmymoney_webpricequote: Identifier "DE0008491002"
kmymoney_webpricequote: Price "52.14"
kmymoney_webpricequote: Date "\"2022-008-004\""

And the KMyMoney window provides the details:

Executing /usr/share/kmymoney/misc/financequote.pl unionfunds NYCB...
Identifier found: 'DE0008491002'
Price found: '52.14' (52,14)
Date found: 'Do. Aug. 4 2022'
Price for NYCB updated (id E000001)

Don't worry about NYCB as symbol, it is not important for my test.
I simply took a demo security to start the test. Important are the
three lines in the middle which are extracted from the "received" data.

So what does KMyMoney print for you on the command line while getting
the quotes? Make sure, the log is not disabled in ~/.config/QtProject/qtlogging.ini


-- 

Regards

Thomas Baumgart

https://www.signal.org/       Signal, the better WhatsApp
-------------------------------------------------------------
Any sufficiently advanced bug is indistinguishable from a feature.
(Rich Kulawiec)
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 868 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney/attachments/20220807/c0a94ad7/attachment-0001.sig>


More information about the KMyMoney mailing list