Skip to content

An error raised frequently #63

@biaji

Description

@biaji

With logs:

2020-06-22 21:07:22.197 T:3086041984   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 characters in position 0-6: ordinal not in range(128)               
                                            Traceback (most recent call last):                                                                             
                                              File "/storage/.kodi/addons/script.embuary.info/plugin.py", line 10, in <module>                             
                                                plugin.run()                                                                                               
                                              File "/storage/.kodi/addons/script.module.routing/lib/routing.py", line 130, in run                          
                                                self._dispatch(self.path)                                                                                  
                                              File "/storage/.kodi/addons/script.module.routing/lib/routing.py", line 141, in _dispatch                    
                                                view_func(**kwargs)                                                                                        
                                              File "/storage/.kodi/addons/script.embuary.info/resources/lib/widgets.py", line 349, in movie_listing        
                                                _listing('movie', call, page, pages)                                                                       
                                              File "/storage/.kodi/addons/script.embuary.info/resources/lib/widgets.py", line 383, in _listing             
                                                result, pages = _query(directory, call, params={'page': page})                                             
                                              File "/storage/.kodi/addons/script.embuary.info/resources/lib/widgets.py", line 451, in _query               
                                                params=args                                                                                                
                                              File "/storage/.kodi/addons/script.embuary.info/resources/lib/tmdb.py", line 82, in tmdb_query               
                                                log('%s --> %s' % (error, url), ERROR)                                                                     
                                            UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128)           
                                            -->End of Python script error report<--    

And the code is :

    except Exception as error:
        log('%s --> %s' % (error, url), ERROR)  #<--------  it seemed the erorr(Exception) contains utf-8 chars
        if show_error:             
            tmdb_error(error)

I think it maybe because the Exception raised from above by code like

            error = ADDON.getLocalizedString(32022)

got an utf-8 string and generated this error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions