[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-08-01 Thread R. David Murray
R. David Murray added the comment: Right, and the python email package fully supports non ascii: >>> msg = EmailMessage() >>> msg['Subject'] = "Panamá- Casco Antiguo" >>> bytes(msg) b'Subject: =?utf-8?q?Panam=C3=A1-?= Casco Antiguo\n\n' >>> str(msg) 'Subject: Panamá- Casco Antiguo\n\n' >>>

[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-08-01 Thread Yun Li
Yun Li added the comment: Hi, David: I don't think your argument stands here. The whole world does not just include English speaking countries. There are Spanish, Russian, Chinese, etc. Any legacy packages should support all languages instead of just English. This is definitely a bug in this

[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-08-01 Thread R. David Murray
R. David Murray added the comment: The input header is not valid (non-ascii is not allowed in headers), so you shouldn't expect make_header to do anything sensible. Note that this is the legacy API, which is a toolkit and does not hold your hand when it comes to RFC compliance. Aside from

[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-07-10 Thread Aldwin Pollefeyt
Change by Aldwin Pollefeyt : -- keywords: +patch pull_requests: +14496 stage: -> patch review pull_request: https://github.com/python/cpython/pull/14696 ___ Python tracker

[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-07-10 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: Changing everything to utf-8 breaks a lot of tests, so here a less invasive solution? diff --git a/Lib/email/header.py b/Lib/email/header.py index 4ab0032bc6..1e71eeae7f 100644 --- a/Lib/email/header.py +++ b/Lib/email/header.py @@ -136,7 +136,14 @@ def

[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-07-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +maxking ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-07-09 Thread Aldwin Pollefeyt
Aldwin Pollefeyt added the comment: Maybe a solution, if no charset defined, then encode it as utf-8 in decode_header, because it's Python3's default encoding? diff --git a/Lib/email/header.py b/Lib/email/header.py index 4ab0032bc6..8dbfe58a57 100644 --- a/Lib/email/header.py +++

[issue37532] email.header.make_header() doesn't work if any `ascii` code is out of range(128)

2019-07-09 Thread Yun Li
New submission from Yun Li : email.header.make_header() doesn't work if any `ascii` code is out of range(128) For example >>> header = "Your booking at Voyager Int'l >>> Hostel,=?UTF-8?B?IFBhbmFtw6EgQ2l0eQ==?=, Panamá- Casco Antiguo" >>> decode_header(header) [(b"Your booking at Voyager