eracknaphobia / plugin.video.nhlgcl

Watch NHL.tv in KODI
GNU General Public License v2.0
25 stars 17 forks source link

One more crash for utf encoding #25

Closed mrawji closed 3 years ago

mrawji commented 3 years ago

I am seeing one more crash

2021-02-10 22:58:30.549 T:139985961330240   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.UnicodeDecodeError'>
                                            Error Contents: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)
                                            Traceback (most recent call last):
                                              File "/home/mrawji/.kodi/addons/plugin.video.nhlgcl/addon.py", line 1, in <module>
                                                from resources.lib.nhl_tv import *
                                              File "/home/mrawji/.kodi/addons/plugin.video.nhlgcl/resources/lib/nhl_tv.py", line 1, in <module>
                                                from resources.lib.globals import *
                                              File "/home/mrawji/.kodi/addons/plugin.video.nhlgcl/resources/lib/globals.py", line 603, in <module>
                                                settings.setSetting(id="fav_team_id", value=getFavTeamId())
                                              File "/home/mrawji/.kodi/addons/plugin.video.nhlgcl/resources/lib/globals.py", line 312, in getFavTeamId
                                                if FAV_TEAM in team['name']:
                                            UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)
                                            -->End of Python script error report<--

To reproduce,

  1. Set your favorite team to Montreal
  2. Start the the plugin
  3. (if it crashes here, skip to step 9)
  4. exit, and set your favorite to Los Angeles (or anyone else)
  5. Start the plugin
  6. Everything should work
  7. exit, and set your favorite to Montreal
  8. Start the Plugin (it should crash)
  9. Start the plugin again

Now, in the settings.xml, the fav_team and fav_team_name will be set the Montreal, but the fav_team_id and fav_team_logo will be of the team picked in step 4.