Lines Matching refs:exc

10     def handle(self, exc):  argument
14 realpos = len(exc.object) + realpos
17 if realpos <= exc.start:
18 self.pos = len(exc.object)
102 def xmlcharnamereplace(exc): argument
103 if not isinstance(exc, UnicodeEncodeError):
104 raise TypeError("don't know how to handle %r" % exc)
106 for c in exc.object[exc.start:exc.end]:
111 return (u"".join(l), exc.end)
133 def uninamereplace(exc): argument
134 if not isinstance(exc, UnicodeEncodeError):
135 raise TypeError("don't know how to handle %r" % exc)
137 for c in exc.object[exc.start:exc.end]:
139 return (u"\033[1m%s\033[0m" % u", ".join(l), exc.end)
180 def relaxedutf8(exc): argument
181 if not isinstance(exc, UnicodeDecodeError):
182 raise TypeError("don't know how to handle %r" % exc)
183 if exc.object[exc.start:exc.start+2] == "\xc0\x80":
184 return (u"\x00", exc.start+2) # retry after two bytes
186 raise exc
231 def handler_unicodeinternal(exc): argument
232 if not isinstance(exc, UnicodeDecodeError):
233 raise TypeError("don't know how to handle %r" % exc)
254 def handler1(exc): argument
255 if not isinstance(exc, UnicodeEncodeError) \
256 and not isinstance(exc, UnicodeDecodeError):
257 raise TypeError("don't know how to handle %r" % exc)
258 l = [u"<%d>" % ord(exc.object[pos]) for pos in xrange(exc.start, exc.end)]
259 return (u"[%s]" % u"".join(l), exc.end)
263 def handler2(exc): argument
264 if not isinstance(exc, UnicodeDecodeError):
265 raise TypeError("don't know how to handle %r" % exc)
266 l = [u"<%d>" % ord(exc.object[pos]) for pos in xrange(exc.start, exc.end)]
267 return (u"[%s]" % u"".join(l), exc.end+1) # skip one character
348 exc = exctype(*args)
349 self.assertEqual(str(exc), msg)
658 def unencrepl(exc): argument
659 if isinstance(exc, UnicodeEncodeError):
660 return (u"\u4242", exc.end)
662 raise TypeError("don't know how to handle %r" % exc)
708 def baddecodereturn1(exc): argument
718 def baddecodereturn2(exc): argument
767 def badencodereturn1(exc): argument
772 def badencodereturn2(exc): argument