Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-Django for openSUSE:Factory 
checked in at 2023-07-24 18:11:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Django (Old)
 and      /work/SRC/openSUSE:Factory/.python-Django.new.1467 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-Django"

Mon Jul 24 18:11:42 2023 rev:105 rq:1099279 version:4.2.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-Django/python-Django.changes      
2023-07-11 15:56:22.676848402 +0200
+++ /work/SRC/openSUSE:Factory/.python-Django.new.1467/python-Django.changes    
2023-07-24 18:11:46.665144754 +0200
@@ -1,0 +2,6 @@
+Tue Jul 18 12:50:29 UTC 2023 - Markéta Machová <mmach...@suse.com>
+
+- Add upstream sanitize_address.patch
+  * fixes build with yet another CPython upstream fix (bsc#1210638)
+
+-------------------------------------------------------------------

New:
----
  sanitize_address.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-Django.spec ++++++
--- /var/tmp/diff_new_pack.sNLzq9/_old  2023-07-24 18:11:47.461149439 +0200
+++ /var/tmp/diff_new_pack.sNLzq9/_new  2023-07-24 18:11:47.465149463 +0200
@@ -33,6 +33,8 @@
 Source1:        
https://media.djangoproject.com/pgp/Django-%{version}.checksum.txt
 Source2:        %{name}.keyring
 Source99:       python-Django-rpmlintrc
+# PATCH-FIX-UPSTREAM 
https://github.com/django/django/commit/da2f8e8257d1bea4215381684ca4abfcee333c43
  Refs #34118 -- Improved sanitize_address() error message for tuple with empty 
strings.
+Patch:          sanitize_address.patch
 BuildRequires:  %{python_module Jinja2 >= 2.9.2}
 BuildRequires:  %{python_module Pillow >= 6.2.0}
 BuildRequires:  %{python_module PyYAML}


++++++ sanitize_address.patch ++++++
>From da2f8e8257d1bea4215381684ca4abfcee333c43 Mon Sep 17 00:00:00 2001
From: Mariusz Felisiak <felisiak.mari...@gmail.com>
Date: Mon, 17 Jul 2023 11:03:36 +0200
Subject: [PATCH] Refs #34118 -- Improved sanitize_address() error message for
 tuple with empty strings.

---
 django/core/mail/message.py | 2 ++
 tests/mail/tests.py         | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/django/core/mail/message.py b/django/core/mail/message.py
index f3fe6186c7f5..4f8c93e9e55e 100644
--- a/django/core/mail/message.py
+++ b/django/core/mail/message.py
@@ -97,6 +97,8 @@ def sanitize_address(addr, encoding):
             domain = token.domain or ""
     else:
         nm, address = addr
+        if "@" not in address:
+            raise ValueError(f'Invalid address "{address}"')
         localpart, domain = address.rsplit("@", 1)
 
     address_parts = nm + localpart + domain
diff --git a/tests/mail/tests.py b/tests/mail/tests.py
index 54a136c1a98b..848ee32e9f80 100644
--- a/tests/mail/tests.py
+++ b/tests/mail/tests.py
@@ -1084,9 +1084,10 @@ def test_sanitize_address_invalid(self):
             "@",
             "to@",
             "@example.com",
+            ("", ""),
         ):
             with self.subTest(email_address=email_address):
-                with self.assertRaises(ValueError):
+                with self.assertRaisesMessage(ValueError, "Invalid address"):
                     sanitize_address(email_address, encoding="utf-8")
 
     def test_sanitize_address_header_injection(self):

Reply via email to