Fishenzon / repo

My repo
53 stars 6 forks source link

urrlib3 addon update broke Idan Plus #178

Closed TwilightMercy closed 8 months ago

TwilightMercy commented 8 months ago

urrlib3 addon updated to 2.1.0:

image

After the update:

error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
            - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
           Error Type: <class 'ImportError'>
           Error Contents: cannot import name 'appengine' from 'urllib3.contrib' (C:\Users\<censored>\AppData\Roaming\Kodi\addons\script.module.urllib3\lib\urllib3\contrib\__init__.py)
           Traceback (most recent call last):
             File "C:\Users\<censored>\AppData\Roaming\Kodi\addons\plugin.video.idanplus\resources\lib\requests_toolbelt\_compat.py", line 48, in <module>
               from requests.packages.urllib3.contrib import appengine as gaecontrib
           ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' (C:\Users\<censored>\AppData\Roaming\Kodi\addons\script.module.urllib3\lib\urllib3\contrib\__init__.py)

           During handling of the above exception, another exception occurred:

           Traceback (most recent call last):
             File "C:\Users\<censored>\AppData\Roaming\Kodi\addons\plugin.video.idanplus\default.py", line 3, in <module>
               from resources.main import route
             File "C:\Users\<censored>\AppData\Roaming\Kodi\addons\plugin.video.idanplus\resources\main.py", line 4, in <module>
               import resources.lib.common as common
             File "C:\Users\<censored>\AppData\Roaming\Kodi\addons\plugin.video.idanplus\resources\lib\common.py", line 4, in <module>
               import resources.lib.cloudscraper as cloudscraper
             File "C:\Users\<censored>\AppData\Roaming\Kodi\addons\plugin.video.idanplus\resources\lib\cloudscraper\__init__.py", line 14, in <module>
               from resources.lib.requests_toolbelt.utils import dump
             File "C:\Users\<censored>\AppData\Roaming\Kodi\addons\plugin.video.idanplus\resources\lib\requests_toolbelt\__init__.py", line 12, in <module>
               from .adapters import SSLAdapter, SourceAddressAdapter
             File "C:\Users\<censored>\AppData\Roaming\Kodi\addons\plugin.video.idanplus\resources\lib\requests_toolbelt\adapters\__init__.py", line 12, in <module>
               from .ssl import SSLAdapter
             File "C:\Users\<censored>\AppData\Roaming\Kodi\addons\plugin.video.idanplus\resources\lib\requests_toolbelt\adapters\ssl.py", line 16, in <module>
               from .._compat import poolmanager
             File "C:\Users\<censored>\AppData\Roaming\Kodi\addons\plugin.video.idanplus\resources\lib\requests_toolbelt\_compat.py", line 50, in <module>
               from urllib3.contrib import appengine as gaecontrib
           ImportError: cannot import name 'appengine' from 'urllib3.contrib' (C:\Users\<censored>\AppData\Roaming\Kodi\addons\script.module.urllib3\lib\urllib3\contrib\__init__.py)
           -->End of Python script error report<--

Previous urllib3 version works: https://mirrors.kodi.tv/addons/nexus/script.module.urllib3/

From the log - the requests_toolbelt dependency broke https://github.com/requests/toolbelt

pierre-leon commented 8 months ago

+1

oferchen commented 8 months ago

+1

mayrund commented 8 months ago

As a workaround, you may consider manually installing urllib3 version 1.26.13 from the following source:

https://mirrors.kodi.tv/addons/nexus/script.module.urllib3/

leeronr commented 8 months ago

Apparently, urllib3 v2 (and through it requests) deprecated support for Google App Engine (GAE), along with anything else that's not CPython or PyPy3 (https://urllib3.readthedocs.io/en/stable/v2-migration-guide.html), so GAE requests will have to be made using a different module.

WIll try to take a look at the code later but @mayrund 's workaround should do the trick for now (edit: and don't forget to disable auto updates...) and I'm sure @Fishenzon is probably already on it anyways.

burekas7 commented 8 months ago

Yes, that's why the told me in their github:

This was removed in 2.0 https://urllib3.readthedocs.io/en/stable/changelog.html#id10

Please read the changelog before upgrading and confirm your system and it's dependencies are compatible. You should determine what plugin is incompatible and file a bug with them as we will not be adding this back.

TwilightMercy commented 8 months ago

Yes, that's why the told me in their github:

This was removed in 2.0 https://urllib3.readthedocs.io/en/stable/changelog.html#id10

Please read the changelog before upgrading and confirm your system and it's dependencies are compatible. You should determine what plugin is incompatible and file a bug with them as we will not be adding this back.

Can you send a link of this issue?

burekas7 commented 8 months ago

cannot import name 'appengine' from 'urllib3.contrib'

They closed it. https://github.com/urllib3/urllib3/issues/3220

oferchen commented 8 months ago

look like requests toolbelt mentions these changes about 7 months ago https://github.com/requests/toolbelt/blob/master/HISTORY.rst can the build be updated to use a more recent requests toolbelt? https://github.com/requests/toolbelt/tree/master pypi source https://pypi.org/project/requests-toolbelt/

Update: I created a patch release 3.5.3 with the required updates there is a pull request open https://github.com/Fishenzon/repo/pull/179

Fishenzon commented 8 months ago

thanks.

I saw this issue only after I alredy release the fix. try ver 3.5.3

asherungar commented 8 months ago

I don’t see the logs but even after updating to version 3.5.3 the addon isn’t working. Thanks

Fishenzon commented 8 months ago

did you try restart Kodi after the update? I need logs to see if there are errors.

asherungar commented 8 months ago

Yes it’s after restart, can you point me to the logs?

oferchen commented 8 months ago

logs are at ~/.kodi/temp/kodi.log

techproent commented 8 months ago

I can confirm v 3.5.3 works for me. thanks for fixing this so fast, much appreciated !!

asherungar commented 8 months ago

here's my log error: ` 2023-12-03 18:49:43.989 T:9394 ERROR : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--

Fishenzon commented 8 months ago

what's the Kodi version? "script.module.requests" version and "script.module.urllib3" version?

asherungar commented 8 months ago

Kodi 19.1 Requests 2.31 Urllib 2.1.0

I downgraded urllib as mentioned above for a workaround for now.

burekas7 commented 8 months ago

I can confirm v 3.5.3 works for me. thanks for fixing this so fast, much appreciated !!

Works for me too. Thanks!