def _headers_identical(self, left, right, header=None):
if header.lower() == '<STR_LIT>':<EOL><INDENT>left = left.replace('<STR_LIT:">', '<STR_LIT>').upper()<EOL>right = right.replace('<STR_LIT:">', '<STR_LIT>').upper()<EOL><DEDENT>left = left.replace('<STR_LIT>', '<STR_LIT:U+0020>').replace('<STR_LIT>', '<STR_LIT:U+0020>')<EOL>right = right.replace('<STR_LIT>', '<STR_LIT:U+0020>').replace('<STR_LIT>', '<STR_LIT:U+0020>')<EOL>if right != left:<EOL><INDENT>return False<EOL><DEDENT>return True<EOL>
Check if headers are (close enough to) identical.

         * This is particularly tricky because Python 2.6, Python 2.7 and
           Python 3 each handle header strings slightly differently.  This
           should mash away all of the differences, though.
         * This also has a small loophole in that when re-writing e-mail
           payload encodings, we re-build the Content-Type header, so if the
           header was originally unquoted, it will be quoted when rehydrating
           the e-mail message.