Message314544
Here's a workaround for Python 2.7:
```
class HeaderBugWorkaround(email.header.Header):
def encode(self, splitchars=' ', **kwargs): # only split on spaces, rather than splitchars=';, '
return email.header.Header.encode(self, splitchars, **kwargs)
# and then...
msg['Subject'] = HeaderBugWorkaround(subject, 'utf-8', header_name='Subject')
```
(If you have the option, you're almost certainly better off moving to Python 3 for anything email related. But if you're maintaining code that has to be Python 2.7 compatible, this might help.) |
|
Date |
User |
Action |
Args |
2018-03-27 18:30:07 | medmunds | set | recipients:
+ medmunds, barry, r.david.murray, SegundoBob, Matthew Jacobi |
2018-03-27 18:30:07 | medmunds | set | messageid: <1522175407.81.0.467229070634.issue25257@psf.upfronthosting.co.za> |
2018-03-27 18:30:07 | medmunds | link | issue25257 messages |
2018-03-27 18:30:07 | medmunds | create | |
|