"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...
HYPTUS price lookup problem
-
- Lemon Slice
- Posts: 755
- Joined: November 4th, 2016, 4:27 pm
-
- Lemon Quarter
- Posts: 3865
- Joined: November 4th, 2016, 9:24 am
Re: HYPTUS price lookup problem
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??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...
Whoever invented this fancy software lark had no idea of the can of worms he was creating....
--kiloran
-
- Lemon Quarter
- Posts: 3865
- Joined: November 4th, 2016, 9:24 am
Re: HYPTUS price lookup problem
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
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
-
- Lemon Quarter
- Posts: 3865
- Joined: November 4th, 2016, 9:24 am
Re: HYPTUS price lookup problem
I've only just realised that this problem is exactly the same as that reported a month ago by baily56: https://www.lemonfool.co.uk/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
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
-
- Lemon Slice
- Posts: 507
- Joined: November 4th, 2016, 9:12 am
Re: HYPTUS price lookup problem
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
cheers
Spiderbill
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
![Laughing :lol:](./images/smilies/icon_lol.gif)
cheers
Spiderbill
-
- Lemon Quarter
- Posts: 4108
- Joined: November 4th, 2016, 9:42 pm
Re: HYPTUS price lookup problem
I'm sorry to report that b-c-3 works fine for me. Was that a money-back guarantee?kiloran wrote:I can absolutely guarantee that when I release the update, it will work fine for all of us. Except youBreelander 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.![]()
--kiloran
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
No, just on loan to Microsoftspiderbill wrote:Bree has clearly sold his soul to the devil![]()
![Twisted Evil :twisted:](./images/smilies/icon_twisted.gif)
-
- Lemon Quarter
- Posts: 3865
- Joined: November 4th, 2016, 9:24 am
Re: HYPTUS price lookup problem
Curses!Breelander wrote: I'm sorry to report that b-c-3 works fine for me. Was that a money-back guarantee?![]()
So my bit of code failed:
if user == 'Breelander':
sys.exit()
else:
continue
I'll work on it
--kiloran
-
- Lemon Half
- Posts: 9516
- Joined: November 4th, 2016, 8:17 pm
Re: HYPTUS price lookup problem
I expect that black magic is cacheing.kiloran wrote: What is addling my brain: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.
- Why does the Basic script work on the original URL yet Python now doesn't?
- Why does it work on Linux Mint and Ubuntu, yet not on Windows 7 or Windows 10?
- Why did it work when I first tried it on Windows 10, yet failed on the second and subsequent attempts just seconds later?
- 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?
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.