From eefeb258ef7e4538f09ee5aeed431a430190872a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 16 Apr 2015 13:31:08 -0700 Subject: [PATCH] Fix codecs end check There was a bug before Python 3.4 where an extra byte was included in e.end when the error callback was called. That hided a bug in the code. Fixes build with Python 3.4+ --- Lib/fontTools/encodings/codecs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/fontTools/encodings/codecs.py b/Lib/fontTools/encodings/codecs.py index 407af6444..186166419 100644 --- a/Lib/fontTools/encodings/codecs.py +++ b/Lib/fontTools/encodings/codecs.py @@ -52,7 +52,7 @@ class ExtendCodec(codecs.Codec): def error(self, e): if isinstance(e, UnicodeDecodeError): - for end in range(e.start + 1, e.end): + for end in range(e.start + 1, e.end + 1): s = e.object[e.start:end] if s in self.mapping: return self.mapping[s], end