Projet

Général

Profil

Development #39934

envoi mail vs destinataires avec des accents

Ajouté par Frédéric Péters il y a environ 4 ans. Mis à jour il y a environ 4 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
17 février 2020
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Exception:
  type = '<class 'UnicodeEncodeError'>', value = ''ascii' codec can't encode character '\xe9' in position 10: ordinal not in range(128)'

Stack trace (most recent call first):
  File "/usr/lib/python3.5/smtplib.py", line 351, in send
   349                 # should not be used, but 'data' needs to convert the string to
   350                 # binary itself anyway, so that's not a problem.
>  351                 s = s.encode(self.command_encoding)
   352             try:
   353                 self.sock.sendall(s)

  locals:
     s = 'rcpt TO:<Cédric....@gmail.com>\r\n'

Fichiers

Révisions associées

Révision b23c2a4c (diff)
Ajouté par Frédéric Péters il y a environ 4 ans

emails: add support for unicode local-parts (if server supports it) (#39934)

Historique

#1

Mis à jour par Frédéric Péters il y a environ 4 ans

On ne peut pas exclure que ça fonctionne (https://tools.ietf.org/html/rfc6531.html).

(plutôt que dupliquer le code, le patch fait également passer par EmailToSend en cas de traitement synchrone)

#2

Mis à jour par Thomas Noël il y a environ 4 ans

  • Statut changé de Solution proposée à Solution validée

Pour enjoliver encore un peu, on pourrait remplacer le s.close() final par un s.quit() plus protocolaire (close n'est pas documentée, j'imagine que c'est plutôt une méthode prévue en interne only)

#3

Mis à jour par Frédéric Péters il y a environ 4 ans

  • Statut changé de Solution validée à Résolu (à déployer)

Poussé avec .quit()

commit b23c2a4c502f2a5ea375ccf81ac6da497c1659ea
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Mon Feb 17 12:44:28 2020 +0100

    emails: add support for unicode local-parts (if server supports it) (#39934)
#4

Mis à jour par Frédéric Péters il y a environ 4 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF