Esempio n. 1
0
 def decode_w(self, object, final=False):
     space = self.space
     state = space.fromcache(CodecState)
     if len(self.pending) > 0:
         object = self.pending + object
     try:
         output = c_codecs.decodeex(self.decodebuf, object, self.errors,
                                    state.decode_error_handler, self.name,
                                    get_ignore_error(final))
     except c_codecs.EncodeDecodeError, e:
         raise wrap_unicodedecodeerror(space, e, object, self.name)
Esempio n. 2
0
 def decode_w(self, object, final=False):
     space = self.space
     state = space.fromcache(CodecState)
     if len(self.pending) > 0:
         object = self.pending + object
     try:
         output = c_codecs.decodeex(self.decodebuf, object, self.errors,
                                    state.decode_error_handler, self.name,
                                    get_ignore_error(final))
     except c_codecs.EncodeDecodeError, e:
         raise wrap_unicodedecodeerror(space, e, object, self.name)
Esempio n. 3
0
 def decode_w(self, object, final=False):
     space = self.space
     state = space.fromcache(CodecState)
     if len(self.pending) > 0:
         object = self.pending + object
     try:
         output = c_codecs.decodeex(self.decodebuf, object, self.errors,
                                    state.decode_error_handler, self.name,
                                    get_ignore_error(final))
     except c_codecs.EncodeDecodeError as e:
         raise wrap_unicodedecodeerror(space, e, object, self.name)
     except RuntimeError:
         raise wrap_runtimeerror(space)
     pos = c_codecs.pypy_cjk_dec_inbuf_consumed(self.decodebuf)
     assert 0 <= pos <= len(object)
     self.pending = object[pos:]
     return space.newunicode(output)
Esempio n. 4
0
 def decode_w(self, object, final=False):
     space = self.space
     state = space.fromcache(CodecState)
     if len(self.pending) > 0:
         object = self.pending + object
     try:
         output = c_codecs.decodeex(self.decodebuf, object, self.errors,
                                    state.decode_error_handler, self.name,
                                    get_ignore_error(final))
     except c_codecs.EncodeDecodeError as e:
         raise wrap_unicodedecodeerror(space, e, object, self.name)
     except RuntimeError:
         raise wrap_runtimeerror(space)
     pos = c_codecs.pypy_cjk_dec_inbuf_consumed(self.decodebuf)
     assert 0 <= pos <= len(object)
     self.pending = object[pos:]
     return space.wrap(output)