diff --git a/NEWS b/NEWS index b4e43373..1e668376 100644 --- a/NEWS +++ b/NEWS @@ -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 ============= diff --git a/glances/outdated.py b/glances/outdated.py index 76e768b7..2b8fd630 100644 --- a/glances/outdated.py +++ b/glances/outdated.py @@ -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 - with open(self.cache_file, 'wb') as f: - pickle.dump(self.data, f) + 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"""