From 7528a819ae46c0b974ac4ab37192594d8b450210 Mon Sep 17 00:00:00 2001 From: Tzachi Strul Date: Sat, 12 Jun 2021 14:29:16 +0300 Subject: [PATCH] Fix skin backup after build backup prior to this fix i got this error when trying to backup sking after build backup: AppData\Roaming\Kodi\addons\plugin.program.openwizard\resources\libs\backup.py", line 439, in _backup_info f.write('programs="{0}"\n'.format(', '.join(programs)) if len(programs) > 0 else 'programs="none"\n') File "C:\Program Files (x86)\Kodi\system\python\Lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 259-263: character maps to --- resources/libs/backup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/libs/backup.py b/resources/libs/backup.py index fbfcb0bf..6414277d 100644 --- a/resources/libs/backup.py +++ b/resources/libs/backup.py @@ -430,7 +430,7 @@ def _backup_info(self, name, extractsize, programs, video, music, picture, repos _skin = xbmcaddon.Addon(_skin_id) _skin_name = xbmcvfs.translatePath(_skin.getAddonInfo('name')) - with open(temp_txt, 'w') as f: + with open(temp_txt, 'w', encoding="utf-8") as f: f.write('name="{0}"\n'.format(name)) f.write('extracted="{0}"\n'.format(extractsize)) f.write('zipsize="{0}"\n'.format(os.path.getsize(backup_zip)))