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+
This commit is contained in:
parent
4ba27843a9
commit
eefeb258ef
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user