接入图灵机器人,为什么没有回复信息会报错,如下
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.3k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
Except in proc_msg
Traceback (most recent call last):
File "/Users/eve/codeing/learn/python/wxin/wxBot/wxbot.py", line 786, in proc_msg
self.handle_msg(r)
File "/Users/eve/codeing/learn/python/wxin/wxBot/wxbot.py", line 759, in handle_msg
self.handle_msg_all(message)
File "bot.py", line 72, in handle_msg_all
self.send_msg_by_uid(self.tuling_auto_reply(msg['user']['id'], msg['content']['data']), msg['user']['id'])
File "bot.py", line 31, in tuling_auto_reply
respond = json.loads(r.text)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with bot.py at tuling_auto_reply, especially line 31 where r.text is parsed, then follow the call chain through wxbot.py lines 759 and 786. Reproduce the Tuling robot request and inspect the returned response; completion should establish and handle the expected behavior when the response is not valid JSON.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100