[New-bugs-announce] [issue33568] Inconsistent behavior of non-ascii handling in EmailPolicy.fold

Licht Takeuchi report at bugs.python.org
Fri May 18 08:12:02 EDT 2018


New submission from Licht Takeuchi <licht-t at outlook.jp>:

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'
```

----------
components: Library (Lib)
messages: 317025
nosy: licht-t
priority: normal
severity: normal
status: open
title: Inconsistent behavior of non-ascii handling in EmailPolicy.fold
versions: Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33568>
_______________________________________


More information about the New-bugs-announce mailing list