Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

Fix adding skin to guifix after build backup #135

Open
wants to merge 1 commit into
base: matrix
Choose a base branch
from

Conversation

tstrul1
Copy link

@tstrul1 tstrul1 commented Jun 12, 2021

prior to this fix i got this error when trying to add skin to guifix 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

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 <undefined>
@drinfernoo
Copy link
Collaborator

This PR still doesn't address invalid addon.xml files... As well as potentially also breaking if a file is not encoded with utf8 when you open it 🤔

@tstrul1
Copy link
Author

tstrul1 commented Jun 13, 2021

This PR still doesn't address invalid addon.xml files... As well as potentially also breaking if a file is not encoded with utf8 when you open it 🤔

This PR doesn't address invalid addon.xml like the issue i opened.
This one is because adding skin to Guifix zip fails UnicodeEncodeError: 'charmap' codec can't encode characters in position 259-263 after build backup finishes.

looks like this function opens a temp_text for writing and its under _backup_info function
its the same temp text file as far as i understand.

Anyway this solved the problem for me, but im not a python developer so if you think its problematic i tried to do my best

@tstrul1 tstrul1 changed the title Fix skin backup after build backup Fix adding skin to guifix after build backup Jun 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants