diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 19eee613..799bb7f5 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -410,6 +410,10 @@ msgctxt "#30416" msgid "Settings for the Plex Server" msgstr "" +msgctxt "#30417" +msgid "Could not change the Kodi settings file {0}. PKC might not work correctly. Error: {1}" +msgstr "" + # PKC Settings - Connection msgctxt "#30500" msgid "Verify Host SSL Certificate (more secure)" diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 276c9f97..6ecaa92e 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -682,7 +682,18 @@ class XmlKodiSetting(object): # Indent and make readable indent(self.root) # Safe the changed xml - self.tree.write(self.path, encoding='utf-8') + try: + self.tree.write(self.path, encoding='utf-8') + except IOError as err: + LOG.error('Could not save xml %s. Error: %s', + self.filename, err) + # Could not change the Kodi settings file {0}. PKC might not + # work correctly. Error: {1} + if not settings('%s_ioerror' % self.filename): + messageDialog(lang(29999), + lang(30417).format(self.filename, err)) + settings('%s_ioerror' % self.filename, + value='warning_shown') def _is_empty(self, element, empty_elements): empty = True