We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
非常感谢你的项目,可以节省许多处理与微信接口连接的工作。 在开发中发现,python3版本的代码在处理加密的消息接口时,返回消息被微信服务器解析失败。经过与官方sample比对,发现问题可能出在加密前的字符串拼接上,python2与python3的len函数返回值不同造成的。 我暂时将 encrypt方法中struct.pack('I', socket.htonl(len(text))) 变更为 struct.pack('I', socket.htonl(len(text.encode())))后程序可以正常执行了。 期待你有更好的解决方案。
The text was updated successfully, but these errors were encountered:
已经修复,具体代码中修改了不少地方以适配 Python 3,主要是 str/bytes 和 unicode/str 的问题。
Sorry, something went wrong.
doraemonext
No branches or pull requests
非常感谢你的项目,可以节省许多处理与微信接口连接的工作。
在开发中发现,python3版本的代码在处理加密的消息接口时,返回消息被微信服务器解析失败。经过与官方sample比对,发现问题可能出在加密前的字符串拼接上,python2与python3的len函数返回值不同造成的。
我暂时将 encrypt方法中struct.pack('I', socket.htonl(len(text))) 变更为 struct.pack('I', socket.htonl(len(text.encode())))后程序可以正常执行了。
期待你有更好的解决方案。
The text was updated successfully, but these errors were encountered: