v19 Issue with logging ?
#1
Hi,

I'm trying to make my addon compatible with matrix & leia.

When I run the plugin I get thi error.

Any tip ?

Code:

2020-04-19 10:50:04.708 T:7292 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'TypeError'>
Error Contents: %b requires a bytes-like object, or an object that implements __bytes__, not 'str'
Traceback (most recent call last):
File "C:\Users\yannb\AppData\Roaming\Kodi\addons\plugin.yb.tv\main.py", line 4, in <module>
from resources.lib import plugin
File "C:\Users\yannb\AppData\Roaming\Kodi\addons\plugin.yb.tv\resources\lib\plugin.py", line 46, in <module>
kodilogging.config()
File "C:\Users\yannb\AppData\Roaming\Kodi\addons\plugin.yb.tv\resources\lib\kodilogging.py", line 42, in config
logger.addHandler(KodiLogHandler())
File "C:\Users\yannb\AppData\Roaming\Kodi\addons\plugin.yb.tv\resources\lib\kodilogging.py", line 16, in __init__
prefix = b"[%s] " % addon_id
TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str'
-->End of Python script error report<--

Thanks.
Reply
#2
bytes (str in Python 2) and str (unicode in Python2) are not compatible types in Python 3 as they should have been from the start because they have different meaning. You cannot use them in the same context in Python 3. The fact that you can do this in Python 2 is a big mistake made by Python developers back when they released Python 2.0.
Reply

Logout Mark Read Team Forum Stats Members Help
Issue with logging ?0