title: email.header.decode_headers() throws an HeaderParseError
body: <p>I'm trying to decode email Subject headers.</p>
  
  <p>I'm doing this (the regex is for adding a space between the two = 's:</p>
  
  <pre><code>header = '=?iso-8859-1?B?TU9UT1IubmwgbmlldXdzYnJpZWYgPiBOaWV1d2UgdmVya29vcHRvcHBl?==?iso-8859-1?B?ciBTdXp1a2kg?='
  header = re.sub(r"(==)(?!$)", u"\0= =", header)
  email.header.decode_header(header)
  </code></pre>
  
  <p>But that throws an HeaderParseError:</p>
  
  <pre><code>HeaderParseError                          Traceback (most recent call last)
  
  /home/leon/&lt;ipython console&gt; in &lt;module&gt;()
  
  /usr/lib/python2.7/email/header.pyc in decode_header(header)
      106                         # now we throw the lower level exception away but
      107                         # when/if we get exception chaining, we'll preserve it.
  --&gt; 108                         raise HeaderParseError
      109                 if dec is None:
      110                     dec = encoded
  </code></pre>
  
  <p>The funny thing is, if I copy the output of the re.sub() to my clipboard and do:</p>
  
  <pre><code>email.header.decode_header('=?iso-8859-1?B?TU9UT1IubmwgbmlldXdzYnJpZWYgPiBOaWV1d2UgdmVya29vcHRvcHBl?= =?iso-8859-1?B?ciBTdXp1a2kg?=')
  </code></pre>
  
  <p>it works!</p>
  
  <p>So I guess something's wrong with the encoding of re.sub() but I don't know how to fix this. </p>