I'm writing application that you can find here.
It has function that I use to obtain changelog list:
def getChangeLog():
"""
This function downloads changelog from our repository.
:return:
list of change strings
"""
return [change.decode().rstrip() for change in urlopen(
'https://raw.githubusercontent.com/Acmpo6ou/PyQtAccounts/master/change.log')]
Then I can use this list to display changes that are added to my application, all I need to do after making changes and committing them to repository is to update change.log
file, so when user will open my application, dialog will be displayed and it will contain changelog.
But for some strange reason urlopen always downloads old change.log file.
Suppose that I have this in my change.log:
Some fixes.
Something is added.
Then suppose that I made some changes, for example serialization standard is changed. So I update my change.log to this:
Changed serialization standard.
When user opens up my application getChangeLog function will obtain change.log file and then it will show dialog with this changelog to user, so user will see something like this:
Changelog for v2.3.6:
* Changed serialization standard.
But for some strange reason this is what will be displayed:
Changelog for v2.3.6:
* Some fixes.
* Something is added.
It displays old change.log I tried my getChangeLog function in python console and it realy returns the old change.log, I even tried to use urlopen by itself to obtain change.log file and it still obtains the old one. Most interesting is that if I will call getChangeLog for a few times it starts returning new change.log
I'm absolutely confused, can someone explain me how to fix this?
Probably the reason is that I always call my getChangeLog
function, which downloads changelog, at startup. And since I test my app a lot - I launch it a lot, and getChangeLog
is called a lot and we download changelog a lot.
So OS thinks: if we download the changelog so often (and it actually changes rarely), then why don't we perform some caching? And instead of actually download changelog OS provides its cached version.
Then, when changelog actually changes OS still provides its cached version and if I call my getChangeLog
function a few times the cache expires and it shows new changelog!
I think this is the problem because when I tried to update on my other machine, which I use not so often and hence where I launch my app not so often, and I saw there new changelog.
Mystery solved.