def decode(self, space, input, errors=None):
     if errors is None:
         errors = "strict"
     state = space.fromcache(CodecState)
     #
     try:
         output = c_codecs.decode(self.codec, input, errors, state.decode_error_handler, self.name)
     except c_codecs.EncodeDecodeError, e:
         raise wrap_unicodedecodeerror(space, e, input, self.name)
Exemple #2
0
 def decode(self, space, input, errors=None):
     if errors is None:
         errors = 'strict'
     state = space.fromcache(CodecState)
     #
     try:
         output = c_codecs.decode(self.codec, input, errors,
                                  state.decode_error_handler, self.name)
     except c_codecs.EncodeDecodeError, e:
         raise wrap_unicodedecodeerror(space, e, input, self.name)
 def decode(self, space, input, errors=None):
     if errors is None:
         errors = 'strict'
     state = space.fromcache(CodecState)
     #
     try:
         output = c_codecs.decode(self.codec, input, errors,
                                  state.decode_error_handler, self.name)
     except c_codecs.EncodeDecodeError as e:
         raise wrap_unicodedecodeerror(space, e, input, self.name)
     except RuntimeError:
         raise wrap_runtimeerror(space)
     return space.newtuple([space.wrap(output),
                            space.wrap(len(input))])
Exemple #4
0
 def decode(self, space, input, errors=None):
     if errors is None:
         errors = 'strict'
     state = space.fromcache(CodecState)
     #
     try:
         output = c_codecs.decode(self.codec, input, errors,
                                  state.decode_error_handler, self.name)
     except c_codecs.EncodeDecodeError as e:
         raise wrap_unicodedecodeerror(space, e, input, self.name)
     except RuntimeError:
         raise wrap_runtimeerror(space)
     return space.newtuple(
         [space.newunicode(output),
          space.newint(len(input))])
Exemple #5
0
 def decode(self, space, input, errors=None):
     if errors is None:
         errors = 'strict'
     state = space.fromcache(CodecState)
     #
     try:
         output = c_codecs.decode(self.codec, input, errors,
                                  state.decode_error_handler, self.name)
     except c_codecs.EncodeDecodeError, e:
         raise OperationError(
             space.w_UnicodeDecodeError,
             space.newtuple([
                 space.wrap(self.name),
                 space.wrap(input),
                 space.wrap(e.start),
                 space.wrap(e.end),
                 space.wrap(e.reason)]))