Skip to content

Commit

Permalink
Merge branch 'release/v0.5.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
doraemonext committed Feb 28, 2015
2 parents eafd275 + 04bbc13 commit 8200858
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
ChangeLog
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

v0.5.3

* 修复 hashlib.sha1 无法 decode unicode 字符串问题 (感谢 `JohnnyZhao <https://github.com/JohnnyZhao>`_)

v0.5.2
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
# built documents.
#
# The short X.Y version.
version = '0.5.2'
version = '0.5.3'
# The full version, including alpha/beta/rc tags.
release = '0.5.2'
release = '0.5.3'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='wechat-sdk',
version='0.5.2',
version='0.5.3',
keywords=('wechat', 'sdk', 'wechat sdk'),
description=u'微信公众平台Python开发包',
long_description=open("README.rst").read(),
Expand Down
4 changes: 2 additions & 2 deletions wechat_sdk/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def check_signature(self, signature, timestamp, nonce):
tmp_list = [self.__token, timestamp, nonce]
tmp_list.sort()
tmp_str = ''.join(tmp_list)
if signature == hashlib.sha1(tmp_str).hexdigest():
if signature == hashlib.sha1(tmp_str.encode('utf-8')).hexdigest():
return True
else:
return False
Expand All @@ -90,7 +90,7 @@ def generate_jsapi_signature(self, timestamp, noncestr, url, jsapi_ticket=None):
keys = data.keys()
keys.sort()
data_str = '&'.join(['%s=%s' % (key, data[key]) for key in keys])
signature = hashlib.sha1(data_str).hexdigest()
signature = hashlib.sha1(data_str.encode('utf-8')).hexdigest()
return signature

def parse_data(self, data):
Expand Down

0 comments on commit 8200858

Please sign in to comment.