[issue33524] non-ascii characters in headers causes TypeError on email.policy.Policy.fold

2018-05-15 Thread radical164
New submission from radical164 : Python 3.6.5 has trouble on folding email messages: Traceback (most recent call last): File "emailtest.py", line 7, in policy.fold("Subject", msg["Subject"]) File "/usr/lib/python3.6/email/policy.py", line 183, i

[issue33529] Infinite loop on folding email if headers has no spaces

2018-05-15 Thread radical164
New submission from radical164 : I just reported a bug about email folding at issue 33524, but this issue is more fatal in some languages like Chinese or Japanese, which does not insert spaces between each words. Python 3.6.5 has this issue, while 3.6.4 does not. Create an email with longer