From 272ab117ae2f24be9f93b3cd74a8a156179e396f16f018f7e2198c8d13864eaf Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Thu, 18 Apr 2024 06:46:26 +0000 Subject: [PATCH] Accepting request 1168719 from home:dgarcia:branches:devel:languages:python:Factory - 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 --- fix-safemimetext-set_payload.patch | 14 ++++++++++++++ python-Django.changes | 6 ++++++ python-Django.spec | 3 +++ 3 files changed, 23 insertions(+) create mode 100644 fix-safemimetext-set_payload.patch 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}