Author tkikuchi
Date 2007-03-15.11:13:52
SpamBayes Score
Marked as misclassified
email.header.Header class has its unicode representation which is slightly different from str representation.

>>> h = email.Header.make_header((('[XXX]', 'us-ascii'), ('Re:', 'us-ascii')))
>>> unicode(h)
>>> str(h)
'[XXX] Re:'

Note that a white space between ']' and 'R' is absent from unicode representation.  A word-separating space should be needed in following contexts:

lastcs \ nextcs | ascii | other |
     ascii      |  sp   |   sp  |
     other      |  sp   | nosp  |

Current code fails to put a space for ascii\ascii case.

Also, if the ascii string has a trailing space, it may result in a extraneous double space which has semantically equivalent to a single space and sometimes annoying.  You should use qp encoding for ascii charset if you insist on the presence of the space.

The patch includes test code. :)
Date User Action Args
2007-08-23 15:57:36adminlinkissue1681333 messages
2007-08-23 15:57:36admincreate