summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolargo <nicolas@nicolargo.com>2017-03-27 09:08:01 +0200
committernicolargo <nicolas@nicolargo.com>2017-03-27 09:08:01 +0200
commit621d708b8bebe00c59cbe93f012cebbf608a767a (patch)
tree0bdd8c8905b4698282934a08a632ea3f6ad33a7c
parent9b1f54bdff02229255e1cb04ba8c608b9380b59b (diff)
glances-version.db Permission denied #1066
-rw-r--r--NEWS1
-rw-r--r--glances/outdated.py9
2 files changed, 7 insertions, 3 deletions
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"""