Message336668
Although I am not personally interested in backporting a fix for this issue, anyone that experiences this issue in python 3.5 can execute the following monkey patch to solve the issue:
def _fix_issue_36041_3_5():
from email._header_value_parser import QuotedString, ValueTerminal, quote_string
import email._header_value_parser
class BareQuotedString(QuotedString):
token_type = 'bare-quoted-string'
def __str__(self):
return quote_string(''.join(str(x) for x in self))
@property
def value(self):
return ''.join(str(x) for x in self)
@property
def parts(self):
parts = list(self)
escaped_parts = []
for part in parts:
if isinstance(part, ValueTerminal):
escaped = quote_string(str(part))[1:-1]
escaped_parts.append(ValueTerminal(escaped, 'ptext'))
else:
escaped_parts.append(part)
# Add quotes to the first and last parts.
escaped_parts[0] = ValueTerminal('"' + str(escaped_parts[0]), 'ptext')
escaped_parts[-1] = ValueTerminal(str(escaped_parts[-1] + '"'), 'ptext')
return escaped_parts
email._header_value_parser.BareQuotedString = BareQuotedString |
|
Date |
User |
Action |
Args |
2019-02-26 13:36:11 | aaryn.startmail | set | recipients:
+ aaryn.startmail, barry, r.david.murray |
2019-02-26 13:36:11 | aaryn.startmail | set | messageid: <1551188171.92.0.209402292964.issue36041@roundup.psfhosted.org> |
2019-02-26 13:36:11 | aaryn.startmail | link | issue36041 messages |
2019-02-26 13:36:11 | aaryn.startmail | create | |
|