Python3 incompatibility : binary mode doesn't take an encoding argument
Closed this issue · 1 comments
Chaotnix commented
When runnning the grabber on my RPI4 with Libreelec 10.0.0 Beta (Kodi 19 Matrix) the following error is thrown:
ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'ValueError'>
Error Contents: binary mode doesn't take an encoding argument
Traceback (most recent call last):
File "/storage/.kodi/addons/service.takealug.epg-grabber/service.py", line 575, in <module>
run_grabber()
File "/storage/.kodi/addons/service.takealug.epg-grabber/service.py", line 387, in run_grabber
write_to_sock()
File "/storage/.kodi/addons/service.takealug.epg-grabber/service.py", line 393, in write_to_sock
epg = open(guide_temp, 'rb', encoding='utf-8')
ValueError: binary mode doesn't take an encoding argument
-->End of Python script error report<--
In line 393 in service.py, guide_temp is opened in binary mode with encoding='utf-8'
When opening a file in binary mode, encoding is not needed.
So encoding option in binary mode is no more allowed in Python 3.
The solution ist to change line 393 from
epg = open(guide_temp, 'rb', encoding='utf-8')
to
epg = open(guide_temp, 'rb')
After this change the plugin is working for me again.
DeBaschdi commented
THX,
fixed in 1.1.1