MycroftAI / adapt

Adapt Intent Parser
Apache License 2.0
710 stars 154 forks source link

AttributeError when re-registering regex #134

Closed krisgesling closed 3 years ago

krisgesling commented 3 years ago

Describe the bug Receiving an AttributeError when attempting to modify an existing Skill.

Reported in Chat by Sgee

To Reproduce

  1. Run Mycroft
  2. Find a Skill that has a regex directory eg Alarm Skill
  3. Change the contents of a dialog file in some way
  4. See error:
    File "/usr/lib/python3.9/concurrent/futures/_base.py", line 329, in _invoke_callbacks
    callback(self)
    File "/home/sweng/mycroft-core/.venv/lib/python3.9/site-packages/pyee/_executor.py", line 56, in _callback
    self.emit('error', exc)
    File "/home/sweng/mycroft-core/.venv/lib/python3.9/site-packages/pyee/_base.py", line 116, in emit
    self._emit_handle_potential_error(event, args[0] if args else None)
    File "/home/sweng/mycroft-core/.venv/lib/python3.9/site-packages/pyee/_base.py", line 86, in _emit_handle_potential_error
    raise error
    File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
    File "/home/sweng/mycroft-core/mycroft/skills/intent_service.py", line 361, in handle_register_vocab
    self.adapt_service.register_vocab(start_concept, end_concept,
    File "/home/sweng/mycroft-core/mycroft/skills/intent_services/adapt_service.py", line 249, in register_vocab
    self.engine.register_regex_entity(regex_str)
    File "/home/sweng/mycroft-core/.venv/lib/python3.9/site-packages/adapt/engine.py", line 160, in register_regex_entity
    self._regex_strings.add(regex_str)
    AttributeError: 'list' object has no attribute 'add'

Environment (please complete the following information):