From 969c5e76ef07a525b7cbcb1e51fa31177e665083 Mon Sep 17 00:00:00 2001 From: FrankWang Date: Sun, 18 Oct 2015 22:03:29 +0800 Subject: [PATCH] Fix bytes not string. --- examples/webhook_examples/webhook_cherrypy_echo_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/webhook_examples/webhook_cherrypy_echo_bot.py b/examples/webhook_examples/webhook_cherrypy_echo_bot.py index 8faac61..05b43a1 100644 --- a/examples/webhook_examples/webhook_cherrypy_echo_bot.py +++ b/examples/webhook_examples/webhook_cherrypy_echo_bot.py @@ -44,7 +44,7 @@ class WebhookServer(object): 'content-type' in cherrypy.request.headers and \ cherrypy.request.headers['content-type'] == 'application/json': length = int(cherrypy.request.headers['content-length']) - json_string = cherrypy.request.body.read(length) + json_string = cherrypy.request.body.read(length).decode("utf-8") update = telebot.types.Update.de_json(json_string) bot.process_new_messages([update.message]) return ''