297
299
# represented in well-formed XML; escape characters that
298
300
# aren't listed in the XML specification
299
301
# (http://www.w3.org/TR/REC-xml/#NT-Char).
306
302
self.message, escape_count = re.subn(
308
304
lambda match: match.group(0).encode('unicode_escape'),