File support-sqlalchemy-1-4.patch of Package python-mailman

Index: mailman-3.3.6/setup.py
===================================================================
--- mailman-3.3.6.orig/setup.py	2022-09-02 05:49:42.000000000 +0200
+++ mailman-3.3.6/setup.py	2022-10-27 11:00:31.427260047 +0200
@@ -128,7 +128,7 @@ case second 'm'.  Any other spelling is
         'python-dateutil>=2.0',
         'passlib',
         'requests',
-        'sqlalchemy>=1.2.3,<1.4',
+        'sqlalchemy>=1.2.3,<1.5',
         'zope.component',
         'zope.configuration',
         'zope.event',
Index: mailman-3.3.6/src/mailman/database/tests/test_factory.py
===================================================================
--- mailman-3.3.6.orig/src/mailman/database/tests/test_factory.py	2022-09-02 05:49:42.000000000 +0200
+++ mailman-3.3.6/src/mailman/database/tests/test_factory.py	2022-10-27 11:00:31.427260047 +0200
@@ -76,10 +76,11 @@ class TestSchemaManager(unittest.TestCas
         # In case of MySQL, you cannot create/drop indexes on primary keys
         # manually as it is handled automatically by MySQL.
         if not is_mysql(config.db.engine):
-            Index('ix_user__user_id').drop(bind=config.db.engine)
             # Don't pollute our main metadata object, create a new one.
             md = MetaData()
             user_table = Model.metadata.tables['user'].tometadata(md)
+            Index('ix_user__user_id', user_table.c._user_id).drop(
+                bind=config.db.engine)
             Index('ix_user_user_id', user_table.c._user_id).create(
                 bind=config.db.engine)
         config.db.commit()
@@ -98,7 +99,11 @@ class TestSchemaManager(unittest.TestCas
         # indexes for primary keys, don't try doing it with that backend.
         if not is_mysql(config.db.engine):
             with suppress(ProgrammingError, OperationalError):
-                Index('ix_user_user_id').drop(bind=config.db.engine)
+                # Don't pollute our main metadata object, create a new one.
+                md = MetaData()
+                user_table = Model.metadata.tables['user'].tometadata(md)
+                Index('ix_user_user_id', user_table.c._user_id).drop(
+                    bind=config.db.engine)
         config.db.commit()
 
     def test_current_database(self):
Index: mailman-3.3.6/src/mailman/model/listmanager.py
===================================================================
--- mailman-3.3.6.orig/src/mailman/model/listmanager.py	2022-09-02 05:49:42.000000000 +0200
+++ mailman-3.3.6/src/mailman/model/listmanager.py	2022-10-27 11:00:31.427260047 +0200
@@ -39,6 +39,11 @@ from mailman.model.mime import ContentFi
 from mailman.utilities.datetime import now
 from mailman.utilities.queries import QuerySequence
 from public import public
+try:
+    from sqlalchemy.engine import Row
+except ImportError:
+    from sqlalchemy.engine import RowProxy as Row
+
 from zope.event import notify
 from zope.interface import implementer
 
@@ -128,7 +133,7 @@ class ListManager:
         """See `IListManager`."""
         result_set = store.query(MailingList)
         for list_id in result_set.values(MailingList._list_id):
-            assert isinstance(list_id, tuple) and len(list_id) == 1
+            assert isinstance(list_id, (tuple, Row)) and len(list_id) == 1
             yield list_id[0]
 
     @property
openSUSE Build Service is sponsored by