Donate to Remove ads

Got a credit card? use our Credit Card & Finance Calculators

Thanks to Anonymous,bruncher,niord,gvonge,Shelford, for Donating to support the site

HYPTUS price lookup problem

Discussions regarding financial software
NeilW
Lemon Slice
Posts: 766
Joined: November 4th, 2016, 4:27 pm
Has thanked: 149 times
Been thanked: 237 times

Re: HYPTUS price lookup problem

#57124

Postby NeilW » June 1st, 2017, 2:50 pm

"Why does the Basic script work on the original URL yet Python now doesn't?"

Well you did ask...

It's all down to how the certificate authorities are accessed by each user of the underlying SSL C code. Likely the libreoffice basic is specifying the correct directory and the embedded python interpreter isn't.

That means basic can verify the Yahoo certificate, but python cannot - so it barfs half way through the redirection process.

Can you tell I've tackled this monster before? I have a wardrobe full of T-shirts...

kiloran
Lemon Quarter
Posts: 4137
Joined: November 4th, 2016, 9:24 am
Has thanked: 3292 times
Been thanked: 2871 times

Re: HYPTUS price lookup problem

#57129

Postby kiloran » June 1st, 2017, 2:57 pm

NeilW wrote:"Why does the Basic script work on the original URL yet Python now doesn't?"

Well you did ask...

It's all down to how the certificate authorities are accessed by each user of the underlying SSL C code. Likely the libreoffice basic is specifying the correct directory and the embedded python interpreter isn't.

That means basic can verify the Yahoo certificate, but python cannot - so it barfs half way through the redirection process.

Can you tell I've tackled this monster before? I have a wardrobe full of T-shirts...

Ah, yes, well.... so how come the embedded python interpreter quite happily runs the code, but a macro run from within libreoffice fails when using the very same embedded python??

Whoever invented this fancy software lark had no idea of the can of worms he was creating....

--kiloran

kiloran
Lemon Quarter
Posts: 4137
Joined: November 4th, 2016, 9:24 am
Has thanked: 3292 times
Been thanked: 2871 times

Re: HYPTUS price lookup problem

#57200

Postby kiloran » June 1st, 2017, 7:23 pm

Right..... problem solved.

NeilW deserves a medal for pointing out the redirection of the Yahoo URL. The fix was then very simple, and I've tested it extensively on various versions of LibreOffice and OpenOffice on Windows 7, Windows 10, Linux Mint and Ubuntu. I've also incorporated the fix in other tools such as the StepOne FTSE350, Simple Yahoo Price Scrape and some personal spreadsheets, and they all now work fine.

Version b-c-3.ods is available at: http://lemonfoolfinancialsoftware.weebl ... op-up.html

--kiloran

kiloran
Lemon Quarter
Posts: 4137
Joined: November 4th, 2016, 9:24 am
Has thanked: 3292 times
Been thanked: 2871 times

Re: HYPTUS price lookup problem

#57210

Postby kiloran » June 1st, 2017, 8:04 pm

I've only just realised that this problem is exactly the same as that reported a month ago by baily56: viewtopic.php?f=27&t=4829

The problem was fixed at the time, so since it's happened again we may be trying to hit a moving target. Having said that, my original fix was very much trial-and-error. I'm rather more hopeful that this time we have a root-cause fix thanks to NeilW

--kiloran

spiderbill
Lemon Slice
Posts: 549
Joined: November 4th, 2016, 9:12 am
Has thanked: 159 times
Been thanked: 184 times

Re: HYPTUS price lookup problem

#57212

Postby spiderbill » June 1st, 2017, 8:20 pm

Rules for dealing with Yahoo:
1. unreliable/missing data at every turn
2. they'll have built their system badly in the first place
3. they'll change it and make it worse

Well done Kiloran for getting a revised version out so quickly (don't have time to test it as I'm up early in the morning to drive to Venice for a flight back to Edinburgh).

Extra credits for NeilW for tracing the redirects.

Bree has clearly sold his soul to the devil :lol:

cheers

Spiderbill

Breelander
Lemon Quarter
Posts: 4184
Joined: November 4th, 2016, 9:42 pm
Has thanked: 1016 times
Been thanked: 1858 times

Re: HYPTUS price lookup problem

#57219

Postby Breelander » June 1st, 2017, 9:11 pm

kiloran wrote:
Breelander wrote:I'm feeling left out - I can't reproduce this problem whatever I try :(
Win10 15063.332, any version of Libre Office Portable, any HYPTUSS up to and including a freshly downloaded b-c-2.

I can absolutely guarantee that when I release the update, it will work fine for all of us. Except you :D

--kiloran


I'm sorry to report that b-c-3 works fine for me. Was that a money-back guarantee? :D

spiderbill wrote:Bree has clearly sold his soul to the devil :lol:


No, just on loan to Microsoft :twisted:

kiloran
Lemon Quarter
Posts: 4137
Joined: November 4th, 2016, 9:24 am
Has thanked: 3292 times
Been thanked: 2871 times

Re: HYPTUS price lookup problem

#57222

Postby kiloran » June 1st, 2017, 9:23 pm

Breelander wrote:I'm sorry to report that b-c-3 works fine for me. Was that a money-back guarantee? :D

Curses!
So my bit of code failed:

if user == 'Breelander':
sys.exit()
else:
continue

I'll work on it

--kiloran

UncleEbenezer
The full Lemon
Posts: 10978
Joined: November 4th, 2016, 8:17 pm
Has thanked: 1505 times
Been thanked: 3050 times

Re: HYPTUS price lookup problem

#64671

Postby UncleEbenezer » July 4th, 2017, 11:47 am

kiloran wrote:What is addling my brain:
  1. Why does the Basic script work on the original URL yet Python now doesn't?
  2. Why does it work on Linux Mint and Ubuntu, yet not on Windows 7 or Windows 10?
  3. Why did it work when I first tried it on Windows 10, yet failed on the second and subsequent attempts just seconds later?
  4. Why does it work when I run the macro using the Python installation embedded within LibreOffice and OpenOffice, yet fails when I run the macro from within LibreOffice and OpenOffice which uses exactly the same Python?
And that's just for starters. I suspect some form of black magic is involved and it's best not to probe too deeply lest I release some malign spirits.

I expect that black magic is cacheing.

The chain of unconditional requests (as illustrated by NeilW) works. But second time around, you have something in cache. Your system sends a conditional request, and something breaks.


Return to “Financial Software - Discussion”

Who is online

Users browsing this forum: No registered users and 21 guests