'Decode the given byte string into a unicode string, using this
reader\'s encoding.  If an exception is encountered that
appears to be caused by a truncation error, then just decode
the byte string without the bytes that cause the trunctaion
error.
Return a tuple ``(chars, num_consumed)``, where ``chars`` is
the decoded unicode string, and ``num_consumed`` is the
number of bytes that were consumed.'

def _incr_decode(self, bytes):

    while True:
        try:
            return self.decode(bytes, u'strict')
        except UnicodeDecodeError as exc:
            if (exc.end == len(bytes)):
                return self.decode(bytes[:exc.start], self.errors)
            elif (self.errors == u'strict'):
                raise
            else:
                return self.decode(bytes, self.errors)
