Mark Sapiro pushed to branch master at GNU Mailman / Mailman Core
Commits:
208d6940 by Mark Sapiro at 2022-07-29T21:33:24-07:00
Fix Connection.sendmail() to avoid unicode unknowns with bytes input.
- - - - -
1b39ac9c by Mark Sapiro at 2022-07-30T05:20:16+00:00
Merge branch 'bytes' into 'master'
Fix Connection.sendmail() to avoid unicode unknowns with bytes input.
See merge request mailman/mailman!1029
- - - - -
1 changed file:
- src/mailman/mta/connection.py
Changes:
=====================================
src/mailman/mta/connection.py
=====================================
@@ -136,7 +136,10 @@ class Connection:
if isinstance(msgtext, str):
msgtext = msgtext.encode('ascii', 'replace').decode('ascii')
else:
- msgtext = msgtext.decode('ascii', 'replace')
+ # We have to do this extra dance because we have to replace when
+ # encoding as ascii to avoid getting unicode unknowns.
+ msgtext = (msgtext.decode('ascii', 'replace').
+ encode('ascii', 'replace').decode('ascii'))
try:
log.debug('envsender: %s, recipients: %s, size(msgtext): %s',
envsender, recipients, len(msgtext))
View it on GitLab:
https://gitlab.com/mailman/mailman/-/compare/3e49d586cef1eaaf030084d1dea1066c7dc43054...1b39ac9c50504a25cf828aa9601fc5b75ada9539
--
View it on GitLab:
https://gitlab.com/mailman/mailman/-/compare/3e49d586cef1eaaf030084d1dea1066c7dc43054...1b39ac9c50504a25cf828aa9601fc5b75ada9539
You're receiving this email because of your account on gitlab.com.
_______________________________________________
Mailman-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/mailman-checkins.python.org/
Member address: [email protected]