From ab688e7a1befb4a0d1fbb3c9b49cbb19c8d2276c Mon Sep 17 00:00:00 2001 From: =?utf8?q?William=20Tis=C3=A4ter?= Date: Tue, 8 Jul 2014 15:52:25 +0200 Subject: [PATCH] Catch `binascii.a2b_hex` errors on Python 3 --- tornado/web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tornado/web.py b/tornado/web.py index 11dab74f9..a0285a4cf 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -1144,7 +1144,7 @@ class RequestHandler(object): version = 1 try: token = binascii.a2b_hex(utf8(cookie)) - except TypeError: + except (binascii.Error, TypeError): token = utf8(cookie) # We don't have a usable timestamp in older versions. timestamp = int(time.time()) -- 2.47.2