diff --git a/fix-safemimetext-set_payload.patch b/fix-safemimetext-set_payload.patch new file mode 100644 index 0000000..516c526 --- /dev/null +++ b/fix-safemimetext-set_payload.patch @@ -0,0 +1,14 @@ +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 diff --git a/python-Django.changes b/python-Django.changes index 3bde453..f1d70f4 100644 --- a/python-Django.changes +++ b/python-Django.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Apr 18 06:39:36 UTC 2024 - Daniel Garcia + +- Add fix-safemimetext-set_payload.patch, to support python 3.11.9+ + (gh#django/django@b231bcd19e57, bsc#1222880) + ------------------------------------------------------------------- Mon Mar 4 14:05:28 UTC 2024 - Alberto Planas Dominguez diff --git a/python-Django.spec b/python-Django.spec index 7239191..fb97c9d 100644 --- a/python-Django.spec +++ b/python-Django.spec @@ -37,6 +37,9 @@ Source99: python-Django-rpmlintrc Patch0: sanitize_address.patch # PATCH-FIX-OPENSUSE: ignore minor failure on Python 3.12 Patch1: dirty-hack-remove-assert.patch +# PATCH-FIX-UPSTREAM: fix-safemimetext-set_payload.patch, gh#django/django@b231bcd19e57 +# Add support for python 3.11.9+ +Patch2: fix-safemimetext-set_payload.patch BuildRequires: %{python_module Jinja2 >= 2.9.2} BuildRequires: %{python_module Pillow >= 6.2.0} BuildRequires: %{python_module PyYAML}