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