From: William Tisäter Date: Tue, 8 Jul 2014 13:52:25 +0000 (+0200) Subject: Catch `binascii.a2b_hex` errors on Python 3 X-Git-Tag: v4.0.0b3~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1097%2Fhead;p=thirdparty%2Ftornado.git Catch `binascii.a2b_hex` errors on Python 3 --- 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())