glances-version.db Permission denied #1066

pull/1073/head
nicolargo 2017-03-27 09:08:01 +02:00
parent 9b1f54bdff
commit 621d708b8b
2 changed files with 7 additions and 3 deletions

1
NEWS
View File

@ -17,6 +17,7 @@ Bugs corrected:
* Fails to start, OSError in sensors_temperatures (issue #1057)
* Crashs after long time running the glances --browser (issue #1059)
* Sensor values don't refresh since psutil backend (issue #1061)
* glances-version.db Permission denied (issue #1066)
Version 2.8.8
=============

View File

@ -123,7 +123,7 @@ class Outdated(object):
with open(self.cache_file, 'rb') as f:
cached_data = pickle.load(f)
except Exception as e:
logger.debug("Cannot read version from cache file: {}".format(e))
logger.debug("Cannot read version from cache file: {} ({})".format(self.cache_file, e))
else:
logger.debug("Read version from cache file")
if (cached_data['installed_version'] != self.installed_version() or
@ -140,8 +140,11 @@ class Outdated(object):
safe_makedirs(self.cache_dir)
# Create/overwrite the cache file
try:
with open(self.cache_file, 'wb') as f:
pickle.dump(self.data, f)
except Exception as e:
logger.error("Cannot write version to cache file {} ({})".format(self.cache_file, e))
def _update_pypi_version(self):
"""Get the latest PyPI version (as a string) via the RESTful JSON API"""