OpenVoiceOS / ovos-skill-ddg

duck duck go skill
Apache License 2.0
3 stars 4 forks source link

json.decoder.JSONDecodeError: Extra data: line 1 column 256 (char 255) #7

Closed goldyfruit closed 2 years ago

goldyfruit commented 3 years ago

When installing this skill on a fresh Mycroft instance (dev) I got this Python trace:

2021-10-29 22:34:59,876 INFO QuestionsAnswersSkill Answer from mycroft-fallback-duck-duck-go.mycroftai
2021-10-29 22:35:00,560 ERROR mycroft.skills.mycroft_skill.mycroft_skill:on_error:923 An error occurred while processing a request in Wolfram Alpha Skill
Traceback (most recent call last):
  File "/home/mycroft/core/mycroft/skills/mycroft_skill/event_container.py", line 73, in wrapper
    handler(message)
  File "/home/mycroft/core/mycroft/skills/common_query_skill.py", line 111, in __handle_question_query
    result = self.CQS_match_query_phrase(search_phrase)
  File "/opt/mycroft/skills/skill-wolfie.jarbasskills/__init__.py", line 116, in CQS_match_query_phrase
    response = self.ask_the_wolf(utt)
  File "/opt/mycroft/skills/skill-wolfie.jarbasskills/__init__.py", line 123, in ask_the_wolf
    utt = self.translate(query, "en", self.lang)
  File "/opt/mycroft/skills/skill-wolfie.jarbasskills/__init__.py", line 96, in translate
    lang_src=lang_src).strip()
  File "/opt/mycroft-venv/lib/python3.7/site-packages/google_trans_new/google_trans_new.py", line 188, in translate
    raise e
  File "/opt/mycroft-venv/lib/python3.7/site-packages/google_trans_new/google_trans_new.py", line 152, in translate
    response = json.loads(response)
  File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.7/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 256 (char 255)
2021-10-29 22:35:00,577 ERROR mycroft.skills.mycroft_skill.mycroft_skill:on_error:923 An error occurred while processing a request in Duck Duck Go Skill
Traceback (most recent call last):
  File "/home/mycroft/core/mycroft/skills/mycroft_skill/event_container.py", line 73, in wrapper
    handler(message)
  File "/home/mycroft/core/mycroft/skills/common_query_skill.py", line 111, in __handle_question_query
    result = self.CQS_match_query_phrase(search_phrase)
  File "/opt/mycroft/skills/skill-ddg.jarbasskills/__init__.py", line 177, in CQS_match_query_phrase
    answer, match, data = self.parse_subintents(utt)
  File "/opt/mycroft/skills/skill-ddg.jarbasskills/__init__.py", line 154, in parse_subintents
    summary = self.ask_the_duck(query)
  File "/opt/mycroft/skills/skill-ddg.jarbasskills/__init__.py", line 209, in ask_the_duck
    utt = self.translate(query, "en", self.lang)
  File "/opt/mycroft/skills/skill-ddg.jarbasskills/__init__.py", line 291, in translate
    lang_src=lang_src).strip()
  File "/opt/mycroft-venv/lib/python3.7/site-packages/google_trans_new/google_trans_new.py", line 188, in translate
    raise e
  File "/opt/mycroft-venv/lib/python3.7/site-packages/google_trans_new/google_trans_new.py", line 152, in translate
    response = json.loads(response)
  File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.7/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 242 (char 241)
JarbasAl commented 3 years ago

thanks for flagging, the google translate package broke again, will switch to a different dependency, i have been doing this in several places already but missed the ddg and wolfram alpha skills

JarbasAl commented 2 years ago

this was fixed in dev branch already, but closing as there has been a full rewrite meanwhile and it no longer applies