forked from pool/python-Django
Daniel Garcia
272ab117ae
- Add fix-safemimetext-set_payload.patch, to support python 3.11.9+ (gh#django/django@b231bcd19e57, bsc#1222880) OBS-URL: https://build.opensuse.org/request/show/1168719 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-Django?expand=0&rev=163
15 lines
764 B
Diff
15 lines
764 B
Diff
Index: Django-4.2.11/django/core/mail/message.py
|
|
===================================================================
|
|
--- Django-4.2.11.orig/django/core/mail/message.py
|
|
+++ Django-4.2.11/django/core/mail/message.py
|
|
@@ -168,7 +168,8 @@ class SafeMIMEText(MIMEMixin, MIMEText):
|
|
def set_payload(self, payload, charset=None):
|
|
if charset == "utf-8" and not isinstance(charset, Charset.Charset):
|
|
has_long_lines = any(
|
|
- len(line.encode()) > RFC5322_EMAIL_LINE_LENGTH_LIMIT
|
|
+ len(line.encode(errors="surrogateescape"))
|
|
+ > RFC5322_EMAIL_LINE_LENGTH_LIMIT
|
|
for line in payload.splitlines()
|
|
)
|
|
# Quoted-Printable encoding has the side effect of shortening long
|