X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/95e2b1d28f81fbeb01e558286806887c556d7a98..2c5e4d6c412c1988b32cb7dbede988bc9dfb815d:/lib/python/Components/config.py diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 44ad6d2a..5507cae9 100755 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -1647,9 +1647,12 @@ class Config(ConfigSubsection): if not base_file: # not the initial config file.. #update config.x.y.value when exist - configEntry = eval(name) - if configEntry is not None: - configEntry.value = val + try: + configEntry = eval(name) + if configEntry is not None: + configEntry.value = val + except (SyntaxError, KeyError): + pass # we inherit from ConfigSubsection, so ... #object.__setattr__(self, "saved_value", tree["config"]) @@ -1658,9 +1661,12 @@ class Config(ConfigSubsection): def saveToFile(self, filename): text = self.pickle() - f = open(filename, "w") - f.write(text) - f.close() + try: + f = open(filename, "w") + f.write(text) + f.close() + except IOError: + print "Config: Couldn't write %s" % filename def loadFromFile(self, filename, base_file=False): f = open(filename, "r")