Fix passing errors to the encoder and decoder functions.
This commit is contained in:
parent
aabc5f6f2f
commit
6b6e2bb8b1
|
@ -30,9 +30,9 @@ class IncrementalEncoder(codecs.IncrementalEncoder):
|
|||
def encode(self, input, final=False):
|
||||
if self.first:
|
||||
self.first = False
|
||||
return codecs.BOM_UTF8 + codecs.utf_8_encode(input, errors)[0]
|
||||
return codecs.BOM_UTF8 + codecs.utf_8_encode(input, self.errors)[0]
|
||||
else:
|
||||
return codecs.utf_8_encode(input, errors)[0]
|
||||
return codecs.utf_8_encode(input, self.errors)[0]
|
||||
|
||||
def reset(self):
|
||||
codecs.IncrementalEncoder.reset(self)
|
||||
|
|
|
@ -102,11 +102,11 @@ class Codec(codecs.Codec):
|
|||
|
||||
class IncrementalEncoder(codecs.IncrementalEncoder):
|
||||
def encode(self, input, final=False):
|
||||
return uu_encode(input, errors)[0]
|
||||
return uu_encode(input, self.errors)[0]
|
||||
|
||||
class IncrementalDecoder(codecs.IncrementalDecoder):
|
||||
def decode(self, input, final=False):
|
||||
return uu_decode(input, errors)[0]
|
||||
return uu_decode(input, self.errors)[0]
|
||||
|
||||
class StreamWriter(Codec,codecs.StreamWriter):
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue