classification
Title: Inconsistent behavior of non-ascii handling in EmailPolicy.fold
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: licht-t
Priority: normal Keywords: patch

Created on 2018-05-18 12:12 by licht-t, last changed 2018-05-19 15:07 by licht-t.

Pull Requests
URL Status Linked Edit
PR 6986 open licht-t, 2018-05-19 15:07
Messages (1)
msg317025 - (view) Author: Licht Takeuchi (licht-t) * Date: 2018-05-18 12:12
policy.utf8 is False, but non-ascii are not well-handled.
Repro. code.

```
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from email.message import EmailMessage
>>> from email.policy import default
>>> 
>>> policy = default.clone()
>>> policy.utf8
False
>>> msg = EmailMessage()
>>> msg["Subject"] = "á"
>>> policy.fold("Subject", msg["Subject"])
'Subject: =?utf-8?q?=C3=A1?=\n'
>>> policy.fold("Subject", 'á')
'Subject: á\n'
```
History
Date User Action Args
2018-05-19 15:07:13licht-tsetkeywords: + patch
stage: patch review
pull_requests: + pull_request6639
2018-05-18 12:12:13licht-tsettype: behavior
2018-05-18 12:12:02licht-tcreate