C0D3D3V / Moodle-DL

Moodle-DL downloads course content fast from Moodle (eg. lecture pdfs)
GNU General Public License v3.0
427 stars 64 forks source link

AttributeError: 'XSOEnumMixin' object has no attribute 'name' #191

Closed daniarla closed 1 year ago

daniarla commented 1 year ago

Description of the bug

I just updated to fedora 38 and I'm having this issue when trying to run moodle-dl as expected in my normal setup.

Even running moodle-dl --help has the same issue.

`Traceback (most recent call last):
  File "/usr/lib64/python3.11/enum.py", line 260, in __set_name__
    enum_member._value_ = enum_class._member_type_(*args)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/aioxmpp/xso/model.py", line 2923, in __init__
    self.xso_class = self._create_class()
                     ^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/aioxmpp/xso/model.py", line 2933, in _create_class
    self._create_name(),
    ^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/aioxmpp/xso/model.py", line 2926, in _create_name
    return "".join(map(str.title, self.name.split("_")))
                                  ^^^^^^^^^
AttributeError: 'XSOEnumMixin' object has no attribute 'name'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/.local/bin/moodle-dl", line 5, in <module>
    from moodle_dl.main import main
  File "/home/user/.local/lib/python3.11/site-packages/moodle_dl/main.py", line 23, in <module>
    from moodle_dl.cli import (
  File "/home/user/.local/lib/python3.11/site-packages/moodle_dl/cli/__init__.py", line 7, in <module>
    from moodle_dl.cli.notifications_wizard import NotificationsWizard
  File "/home/user/.local/lib/python3.11/site-packages/moodle_dl/cli/notifications_wizard.py", line 3, in <module>
    from aioxmpp.errors import StanzaError, UserError
  File "/home/user/.local/lib/python3.11/site-packages/aioxmpp/__init__.py", line 101, in <module>
    from .errors import (  # NOQA
  File "/home/user/.local/lib/python3.11/site-packages/aioxmpp/errors.py", line 109, in <module>
    class ErrorCondition(structs.CompatibilityMixin, xso.XSOEnumMixin, enum.Enum):
  File "/usr/lib64/python3.11/enum.py", line 557, in __new__
    raise exc
  File "/usr/lib64/python3.11/enum.py", line 266, in __set_name__
    raise new_exc
TypeError: _value_ not set in __new__, unable to create it

Steps to reproduce the issue

Run moodle-dl normally

Technical details

C0D3D3V commented 1 year ago

xD I somehow have the feeling we should move away from aioxmpp

jfrcom commented 1 year ago

Can confirm, just upgraded moodle-dl as I haven't done so in months. Same error as @daniarla occurs when running moodle-dl.

Rincewind34 commented 1 year ago

Do you have an estimate when this bug is fixed or where it first occurred? I tried downgrading to the last minor release but still not luck. The very original 2.0 works for me

C0D3D3V commented 1 year ago

I think it is a bug with aioxmpp I guess it should work with versions that do not use aioxmpp. But I can make a fix tonight or tomorrow. I would also welcome if someone does a PR, we could just make a try except to handle the import error of aioxmpp for now, and I would also welcome a move to python-nbxmpp https://dev.gajim.org/gajim/python-nbxmpp since that is used by thousends of users it should be more stable.

C0D3D3V commented 1 year ago

just for the record the first version with aioxmpp is 2.2.0.0 https://github.com/C0D3D3V/Moodle-DL/releases/tag/v2.2.0.0

jfrcom commented 1 year ago

@C0D3D3V I'm not able to pinpoint where exactly the error occurs. Would you be able to point me into the right direction?

C0D3D3V commented 1 year ago

Please test if the latest release, fixes the issue

daniarla commented 1 year ago

Please test if the latest release, fixes the issue It does!