Ddg3.py (duck duck go) needs update for Python 3.9

ddg3.py needs update for Python 3.9.
Fix requires changing getiterator() to iter() in ddg3.py. It’s not obvious who to contact about upstream fix, in the meantime mycroft could probably implement a patch.

Traceback (most recent call last):
File “/home/kelly/mycroft-core/mycroft/skills/mycroft_skill/event_container.py”, line 66, in wrapper
handler(message)
File “/home/kelly/mycroft-core/mycroft/skills/common_query_skill.py”, line 76, in __handle_question_query
result = self.CQS_match_query_phrase(search_phrase)
File “/opt/mycroft/skills/mycroft-fallback-duck-duck-go.mycroftai/init.py”, line 133, in CQS_match_query_phrase
answer = self.respond(query[len(test):])
File “/opt/mycroft/skills/mycroft-fallback-duck-duck-go.mycroftai/init.py”, line 109, in respond
r = ddg.query(query)
File “/home/kelly/mycroft-core/.venv/lib/python3.9/site-packages/ddg3.py”, line 30, in query
return Results(xml)
File “/home/kelly/mycroft-core/.venv/lib/python3.9/site-packages/ddg3.py”, line 49, in init
self.results = [Result(elem) for elem in xml.getiterator(‘Result’)]
AttributeError: ‘xml.etree.ElementTree.Element’ object has no attribute ‘getiterator’

ddg3 Python library is not part of Mycroft, you will have to speak directly to the maintainer[1] or open an issue on GitHub.

In the mean time, you could have a look to @JarbasAl Duck Duck Go skill (from yesterday ^^) [2], it works with the same intents plus some new ones.

$ . mycroft-core/.venv/bin/activate
$ msm install https://github.com/JarbasSkills/skill-ddg.git

[1]https://pypi.org/project/ddg3/
[2]https://github.com/JarbasSkills/skill-ddg

Best to open an issue on github for things like that.

Edit: I should read better before posting…

2 Likes