diff --git a/mailman-support-sqlalchemy-1-4.patch b/mailman-support-sqlalchemy-1-4.patch new file mode 100644 index 0000000..cb2f5f0 --- /dev/null +++ b/mailman-support-sqlalchemy-1-4.patch @@ -0,0 +1,71 @@ +The TypeDecorator.cache_ok class-level flag indicates if this custom +TypeDecorator is safe to be used as part of a cache key. This flag defaults to +None which will initially generate a warning when the SQL compiler attempts to +generate a cache key for a statement that uses this type. If the TypeDecorator +is not guaranteed to produce the same bind/result behavior and SQL generation +every time, this flag should be set to False; otherwise if the class produces +the same behavior each time, it may be set to True. See TypeDecorator.cache_ok +for further notes on how this works. + +As I don't know if those can be safely cached, just disable the warning. + +Index: mailman-3.3.5/src/mailman/database/types.py +=================================================================== +--- mailman-3.3.5.orig/src/mailman/database/types.py 2021-09-06 02:19:59.000000000 +0200 ++++ mailman-3.3.5/src/mailman/database/types.py 2022-06-23 08:57:19.527825754 +0200 +@@ -34,6 +34,7 @@ class Enum(TypeDecorator): + converts it on-the-fly. + """ + impl = Integer ++ cache_ok = False + + def __init__(self, enum, *args, **kw): + super().__init__(*args, **kw) +@@ -59,6 +60,7 @@ class UUID(TypeDecorator): + + """ + impl = CHAR ++ cache_ok = False + + def load_dialect_impl(self, dialect): + if dialect.name == 'postgresql': +@@ -97,6 +99,7 @@ class SAUnicode(TypeDecorator): + column needs to be indexed, otherwise use SAUnicode4Byte. + """ + impl = Unicode ++ cache_ok = False + + + @compiles(SAUnicode) +@@ -120,6 +123,7 @@ class SAUnicode4Byte(TypeDecorator): + type and it can still be used if needed in the codebase. + """ + impl = Unicode ++ cache_ok = False + + + @compiles(SAUnicode4Byte) +@@ -140,6 +144,7 @@ class SAUnicodeLarge(TypeDecorator): + This is double size of SAUnicode defined above. + """ + impl = Unicode ++ cache_ok = False + + + @compiles(SAUnicodeLarge, 'mysql') +@@ -166,6 +171,7 @@ class SAUnicodeXL(TypeDecorator): + See https://docs.sqlalchemy.org/en/latest/dialects/mysql.html#index-length + """ + impl = Unicode ++ cache_ok = False + + + @compiles(SAUnicodeXL, 'mysql') +@@ -187,6 +193,7 @@ class SAText(TypeDecorator): + case of other dialects defaults to the Text type. + """ + impl = Text ++ cache_ok = False + + + @compiles(SAText) diff --git a/python-mailman.changes b/python-mailman.changes index 0b6507d..cf950ef 100644 --- a/python-mailman.changes +++ b/python-mailman.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Wed Jun 29 18:14:25 UTC 2022 - Lars Vogdt + +- added mailman-support-sqlalchemy-1-4.patch (from Andreas Schneider): + The TypeDecorator.cache_ok class-level flag indicates if this custom + TypeDecorator is safe to be used as part of a cache key. This flag defaults to + None which will initially generate a warning when the SQL compiler attempts to + generate a cache key for a statement that uses this type. If the TypeDecorator + is not guaranteed to produce the same bind/result behavior and SQL generation + every time, this flag should be set to False; otherwise if the class produces + the same behavior each time, it may be set to True. See TypeDecorator.cache_ok + for further notes on how this works. + ------------------------------------------------------------------- Mon Jun 13 09:09:17 UTC 2022 - Andreas Schneider diff --git a/python-mailman.spec b/python-mailman.spec index b8aa9c5..95b5fc1 100644 --- a/python-mailman.spec +++ b/python-mailman.spec @@ -70,6 +70,8 @@ Patch2: support-alembic-1-8.patch # PATCH-FIX-UPSTREAM ARC-message-fail-tests.patch bsc#[0-9]+ mcepl@suse.com # this patch makes things totally awesome Patch3: ARC-message-fail-tests.patch +# Disable cache_ok warnings on console messages: disable caching completely at the moment +Patch4: mailman-support-sqlalchemy-1-4.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildArch: noarch