sale13 / romcollectionbrowser

Automatically exported from code.google.com/p/romcollectionbrowser
GNU General Public License v2.0
0 stars 0 forks source link

bug exporting game db to nfo's #202

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. context menu
2. export game database

What is the expected output? What do you see instead?

Expect all game details to be exported to nfo's

What version of the product are you using? On what operating system?

win7 -> kodi 14.1 -> rcb 2.1.1

Please provide any additional information below.

LogLines:
15:27:22 T:8068  NOTICE: RCB_INFO: current rom file: C:\games\GBA\Grand Theft 
Auto Advance (USA).gba
15:27:22 T:8068  NOTICE: RCB_INFO: gamename (file): Grand Theft Auto Advance 
(USA).gba
15:27:22 T:8068  NOTICE: RCB_INFO: gamename (friendly): Grand Theft Auto 
Advance (USA)
15:27:22 T:8068  NOTICE: RCB_INFO: Begin createNfoFromDesc
15:27:22 T:8068   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python 
callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnicodeEncodeError'>
                                            Error Contents: 'ascii' codec can't encode character u'\xa0' in position 6: ordinal not in range(128)
                                            Traceback (most recent call last):
                                              File "C:\Users\Home\AppData\Roaming\Kodi\addons\script.games.rom.collection.browser\resources\lib\dialogcontextmenu.py", line 210, in onClick
                                                nfowriter.NfoWriter().exportLibrary(self.gui)
                                              File "C:\Users\Home\AppData\Roaming\Kodi\addons\script.games.rom.collection.browser\resources\lib\nfowriter.py", line 101, in exportLibrary
                                                players, rating, votes, url, region, media, perspective, controller, originalTitle, alternateTitle, version, genreList, isFavorite, launchCount, romFile, gamenameFromFile, artworkfiles, artworkurls)
                                              File "C:\Users\Home\AppData\Roaming\Kodi\addons\script.games.rom.collection.browser\resources\lib\nfowriter.py", line 123, in createNfoFromDesc
                                                SubElement(root, 'genre').text = str(genre)
                                            UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 6: ordinal not in range(128)
                                            -->End of Python script error report<--
15:27:22 T:8068  NOTICE: RCB_INFO: onAction: ACTION_CONTEXT

select genreid from genregame where gameid = 3284

returns
242,301,352

242 = Racing
301 = Mission Based
352 = Racing / Driving

I think 352 is the issue

Possible solution

Found this article which seems to match up, I know nothing about python or 
encoding though so don't take my word.

http://stackoverflow.com/questions/10993612/python-removing-xa0-from-string

Original issue reported on code.google.com by geoff...@gmail.com on 23 Feb 2015 at 8:31