[issue39757] EmailMessage wrong encoding for international domain

2020-02-27 Thread SilentGhost


Change by SilentGhost :


--
superseder:  -> email parseaddr and formataddr should be IDNA aware

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39757] EmailMessage wrong encoding for international domain

2020-02-27 Thread Julien Castiaux


Julien Castiaux  added the comment:

Woops wrong copie/paste, here is the correct link: 
https://bugs.python.org/issue11783

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39757] EmailMessage wrong encoding for international domain

2020-02-27 Thread Julien Castiaux


Julien Castiaux  added the comment:

Duplicate of https://bugs.python.org/issue39757

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39757] EmailMessage wrong encoding for international domain

2020-02-26 Thread Julien Castiaux


Change by Julien Castiaux :


--
keywords: +patch
pull_requests: +18023
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18667

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39757] EmailMessage wrong encoding for international domain

2020-02-26 Thread Julien Castiaux

New submission from Julien Castiaux :

Affected python version: 3.5 and above (did test them all except 3.9)

Steps to reproduce:

  from mail.message import EmailMessage
  from mail.policy import SMTP

  msg = EmailMessage(policy=SMTP)
  msg['To'] = 'Joe '  # notice the é in the domain
  print(msg.as_string())

It prints

To: "Joe "

But it should be

To: "Joe "

While b64/qp can be used to encode most non-ascii headers, the domain part of 
an email address is an exception. According to IDNA2008 (rfc5890 , rfc5891), 
non-ascii domain should be encoded using the punycode algorithm and the ACE 
prefix.

--
components: email
messages: 362687
nosy: Julien Castiaux, barry, r.david.murray
priority: normal
severity: normal
status: open
title: EmailMessage wrong encoding for international domain
type: behavior
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com