This wrapper is used in the implementation of clean_subject(). Since all
headers are returned as unicode objects, it will cause a
UnicodeDecodeError if the subject contains unicode and clean_subject()
is called.
yield cls(message_id)
-class Subject(str):
+class Subject(unicode):
RE_RE = re.compile("((RE|FW|FWD|HA)([[]\d])*:\s*)*", re.I)
def __new__(cls, *args, **kw):
- return str.__new__(cls, *args, **kw)
+ return unicode.__new__(cls, *args, **kw)
def strip_replies(self):
return self.RE_RE.sub('', self)