Plugin.video.netflix: Python 2.7 encoding error

Created on 22 Aug 2019  路  27Comments  路  Source: CastagnaIT/plugin.video.netflix

  • [x] bug report
  • [ ] feature request
  • [ ] support request

General information

Addon version used

v15.0, github master branch

Description

python encoding error when installing this plugin on OSMC 18.3 on Raspberry Pi 3B

i had to downgrade to 14.6

Steps to Reproduce

  1. Installing OSMC 18.3 on Raspberry Pi 3B

  2. Follow theses step: https://discourse.osmc.tv/t/how-to-all-platforms-can-i-use-netflix-on-osmc-post-4/54741/4

    to install the plugin with dependencies

  3. installing the plugin with OSMC with the zip file installer

Expected behavior: Installing the plugin properly

Actual behavior: Getting an error when installing or trying to launch with the message "check the log for more information"

i had to downgrade to the 14.6 to make it work

Context (Environment)

Installation

  • [x] I'm using this Netflix Repo
  • [ ] I'm using other Netflix Repo (Please specify which)
  • [ ] I'm using a different source (Please tell which)

Operating System

  • [ ] Linux (x86/x64)
  • [ ] OSX (x86/x64)
  • [ ] Windows (x86/x64)
  • [x] Linux (ARM)
  • [ ] Android

Additional informatin on the environment

OSMC 18.3 on Raspberry Pi 3B

Debug log

2019-08-22 17:25:05.994 T:1790329568   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.LookupError'>
                                            Error Contents: no codec search functions registered: can't find encoding
                                            Traceback (most recent call last):
                                              File "/home/osmc/.kodi/addons/plugin.video.netflix/service.py", line 18, in <module>
                                                g.init_globals(sys.argv)
                                              File "/home/osmc/.kodi/addons/plugin.video.netflix/resources/lib/globals.py", line 217, in init_globals
                                                self.PATH = unquote(self.URL[2][1:]).decode('utf-8')
                                            LookupError: no codec search functions registered: can't find encoding
                                            -->End of Python script error report<--

All 27 comments

This is an error I already saw.

Usually, restarting Kodi solves the issue.

no help without a full debug log

@CastagnaIT it's a random error at service startup. I couldn't catch it in debug yet.

Followed the same install instructions as @TuxSeb
Netflix add-on:
addon id="plugin.video.netflix" name="Netflix" version="0.15.0" provider-name="libdev + jojo + asciidisco + caphm + castagnait"

kodi debug log OSMC 18.3:
https://paste.osmc.tv/wamebenigo

@zjoasan to you happens sometime or always?

Every restart of kodi (4 in a row), when ever the background service should start i get "Netflix error check log", no succesfull start of beckground service

Tried two reboots with @EliasHI fix, still no change, no succesfull start of background service

it's not a good thing use import in that way, apply that workaround could fix only in that part of code but not in the whole project

it is necessary to understand if the problem is in the python package of the osmc build
I do not exclude a problem in the python libraries of OSMC build

I read old messages in the forum of other people complaining about the same problem in other addons and have not solved

I can't remember if I encounter the issue before Kodi 18.2 here. Not a very useful comment, but if someone can test...

Oh, sorry about that, didn't realise I made the pull request it, didn't mean for it to be public. (or does github link it automatically?). As I wasn't sure it worked.

it's not a good thing use import in that way, apply that workaround could fix only in that part of code but not in the whole project

No I agree, I was just experimenting, didn't know it went "public" like this. I Don't use github that often.

@EliasHI you didn't open a pull request. Just you referenced the issue in the commit description, so it appears here.

It allows the changes to be discussed, no need for any apologises.

Gonna try to do a trail update to buster inside OSMC, to see if the problem lays in python libs. There is no timeframe sofar for Buster upgrade in OSMC.

Well upgraded to buster, uninstalled Netflix add-on (including settings), installed 0.15 again, still error as soon as it tries to start background service. Install completes then seconds later "Netflix error check logs". Debug logs, starting Kodi, getting error, navigate to Netflix addon, trying to start it.

https://paste.osmc.tv/iyedinawoz

using import codecs fixes the issue in globals.py

This may not be the right way to fix it definitely, but at least it gives something to look for.

[Edit] Tried with OSMC 2019-04-20 for RPi3. [/Edit]

but this doesn't help...
that module "codecs" should already be present
if it were really a problem in the code, it should happen to all systems kodi versions (windows, android etc...) but to now is only limited to OSMC

can be a problem between modules
this makes me think of a different or wrong python interpreter configuration in OSMC or something similar, i have no idea how it is configured

first you need to understand if it happens on other platforms other that "OSMC kodi"
so i'm waiting to see if anyone else finds this error

@TuxSeb said

i had to downgrade to the 14.6 to make it work

This makes me think we changed something making OSMC (and LibreELEC from time to time) loosing the codecs, as if I'm correct, the line code broken is present in the code since at least Caphm fork...

I just installed on kubuntu, same error
something happens with the linux platform

Ok the problem seems to be here:

# Add absolute paths of embedded py modules to python system directory module_paths = [ os.path.join(self.ADDON_DATA_PATH, 'modules', 'enum'), os.path.join(self.ADDON_DATA_PATH, 'modules', 'mysql-connector-python') ] for path in module_paths: if path not in sys.path: sys.path.insert(0, path)

If I remove that part of code, I have no more the encoding error, an error is thrown later at import resources.lib.database.db_local as db_local (expected as embeded modules paths are not present anymore)

missing xbmc.translatePath(

tested now work how it should

if anyone can confirm by downloading the currest master repo
thanks

Working like a charm on OSMC 18.3, with the latest master repo.

very well

Although now i'm using buster, but that shouldn't be an issue i hope. Gonna so a clean install OSMC and try again.

well however i released the update

Tried on another OSMC system that was still stretch based, working there too.

Thanks for a quick fix.

Was this page helpful?
0 / 5 - 0 ratings