nl: slice the rawdata from i-th to the j-th element, replace with it '%r' in the string "bad end tag: %r", use it to call the method self.error.
code: self . error ( "bad end tag: %r" % ( rawdata [ i : j ] , ) )