script.module.youtube.dl icon indicating copy to clipboard operation
script.module.youtube.dl copied to clipboard

TypeError: __class__ assignment: only for heap types (YoutubeDLWrapper.py, line 27)

Open ypchen opened this issue 7 years ago • 1 comments

Hi, I am using LibreELEC 8.2.1 (Krypton 17.6) / LibreELEC 8.2.01 (Krypton 17.5) and entered the following error when importing script.module.youtube.dl (17.709.0) in my addon.xml with

<import addon="script.module.youtube.dl" version="17.709.0"/>

The log contains:

13:01:48.167 T:1470624672 NOTICE: script.module.youtube.dl: youtube_dl core version: 2017.07.09 13:05:21.647 T:1858073504 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.TypeError'> Error Contents: class assignment: only for heap types Traceback (most recent call last): File "/storage/.kodi/addons/plugin.video.hdp_ims/addon.py", line 26, in import YDStreamExtractor File "/storage/.kodi/addons/script.module.youtube.dl/lib/YDStreamExtractor.py", line 8, in import YoutubeDLWrapper File "/storage/.kodi/addons/script.module.youtube.dl/lib/YoutubeDLWrapper.py", line 27, in sys.stderr.class = replacement_stderr TypeError: class assignment: only for heap types -->End of Python script error report<--

For now, I comment out line 27 in YoutubeDLWrapper.py as

#sys.stderr.__class__ = replacement_stderr

and everything works for me (I only use "YDStreamExtractor.getVideoInfo()" and "vid.streamURL()")

However, the situation still exists. Is this issue already known? Or I am doing something wrong?

(I understand there is a reason to replace sys.stderr, but why does it seem that only I am hit by this error?)

ypchen avatar Nov 23 '17 05:11 ypchen

Today I tested it on Amazon Fire TV Stick with side-loaded Kodi 17.6 Krypton and got the same TypeError. Probably not specific to LibreELEC?

ypchen avatar Nov 26 '17 11:11 ypchen