Deluge 2.10 removed all py2 support

Issue #67 resolved
DjLegolas created an issue

Starting from Deluge 2.10, all of python2 support is being dropped.

This will break YARSS2 as there are checks for PY2 compatibility:

08:31:01.218 [ERROR   ][deluge.pluginmanagerbase          :78  ] Unable to instantiate plugin 'YaRSS2' from 'c:\\users\\user\\appdata\\roaming\\deluge\\plugins\\yarss2-2.1.4-py3.8.egg'!
08:31:01.218 [ERROR   ][deluge.pluginmanagerbase          :78  ] cannot import name 'PY2' from 'deluge.common' (C:\Python38\lib\site-packages\deluge-2.0.6.dev10-py3.8.egg\deluge\common.py)
Traceback (most recent call last):
  File "C:\Python38\lib\site-packages\deluge-2.0.6.dev10-py3.8.egg\deluge\pluginmanagerbase.py", line 147, in enable_plugin
    instance = cls(plugin_name.replace('-', '_'))
  File "c:\users\user\appdata\roaming\deluge\plugins\yarss2-2.1.4-py3.8.egg\yarss2\__init__.py", line 58, in __init__
    from .gtk3ui.gtkui import GtkUI as GtkUIPluginClass
  File "<frozen zipimport>", line 259, in load_module
  File "c:\users\user\appdata\roaming\deluge\plugins\yarss2-2.1.4-py3.8.egg\yarss2\gtk3ui\gtkui.py", line 33, in <module>
    from .dialog_subscription import DialogSubscription
  File "<frozen zipimport>", line 259, in load_module
  File "c:\users\user\appdata\roaming\deluge\plugins\yarss2-2.1.4-py3.8.egg\yarss2\gtk3ui\dialog_subscription.py", line 14, in <module>
    from yarss2.gtk3ui.path_chooser import PathChooser
  File "<frozen zipimport>", line 259, in load_module
  File "c:\users\user\appdata\roaming\deluge\plugins\yarss2-2.1.4-py3.8.egg\yarss2\gtk3ui\path_chooser.py", line 15, in <module>
    import yarss2.gtk3ui.path_combo_chooser
  File "<frozen zipimport>", line 259, in load_module
  File "c:\users\user\appdata\roaming\deluge\plugins\yarss2-2.1.4-py3.8.egg\yarss2\gtk3ui\path_combo_chooser.py", line 17, in <module>
    from deluge.common import PY2
ImportError: cannot import name 'PY2' from 'deluge.common' (C:\Python38\lib\site-packages\deluge-2.0.6.dev10-py3.8.egg\deluge\common.py)

Therefor, a refactor is needed.

Comments (3)

  1. DjLegolas reporter

    I thought there would be another cases were the code will break because of the changes, but I was wrong. 😳
    @Calum Lind - restoring the PY2 variable in delug.commom fixed this issue. 👍

  2. Log in to comment