Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Commit

Permalink
修复Poll协议变更引起的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
pandolia committed Jan 19, 2018
1 parent 77fd6c9 commit 44c5469
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2018-1-19 qqbot v2.3.10
1) 修复Poll协议变更引起的错误

2018-1-13 qqbot v2.3.9
1) 修复Poll协议变更引起的错误

Expand Down
8 changes: 7 additions & 1 deletion qqbot/basicqsession.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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&'
Expand Down
2 changes: 1 addition & 1 deletion qqbot/qconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
if p not in sys.path:
sys.path.insert(0, p)

version = 'v2.3.9'
version = 'v2.3.10'

sampleConfStr = '''
{
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup

version = 'v2.3.9'
version = 'v2.3.10'

setup(
name = 'qqbot',
Expand Down

0 comments on commit 44c5469

Please sign in to comment.