diff --git a/changes b/changes index 4304dee..d80be10 100644 --- a/changes +++ b/changes @@ -1,3 +1,6 @@ +2018-1-19 qqbot v2.3.10 +1) 修复Poll协议变更引起的错误 + 2018-1-13 qqbot v2.3.9 1) 修复Poll协议变更引起的错误 diff --git a/qqbot/basicqsession.py b/qqbot/basicqsession.py index 4f4420f..7a1b120 100644 --- a/qqbot/basicqsession.py +++ b/qqbot/basicqsession.py @@ -206,6 +206,12 @@ def Poll(self): 'callback=1&id=2'), expectedCodes = (0, 100003, 100100, 100012) ) + # "{'retcode': 0, 'retmsg': 'ok', 'errmsg': 'error'}" + if type(result) is dict and \ + result.get('retcode', 1) == 0 and \ + result.get('errmsg', '') == 'error': + DEBUG(result) + raise RequestError except RequestError: ERROR('接收消息出错,开始测试登录 cookie 是否过期...') try: @@ -351,7 +357,7 @@ def smartRequest(self, url, data=None, Referer=None, Origin=None, nCE += 1 errorInfo = '网络错误 %s' % e else: - html = resp.content if not PY3 else resp.content.decode('utf8') + html = resp.content if not PY3 else resp.content.decode('utf8') if resp.status_code in (502, 504, 404): self.session.get( ('http://pinghot.qq.com/pingd?dm=w.qq.com.hot&' diff --git a/qqbot/qconf.py b/qqbot/qconf.py index bfb7ca8..83a14a6 100644 --- a/qqbot/qconf.py +++ b/qqbot/qconf.py @@ -5,7 +5,7 @@ if p not in sys.path: sys.path.insert(0, p) -version = 'v2.3.9' +version = 'v2.3.10' sampleConfStr = ''' { diff --git a/setup.py b/setup.py index c61a6ed..3b43e8f 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup -version = 'v2.3.9' +version = 'v2.3.10' setup( name = 'qqbot',