From 275e2faa80c596b2322b9b29b03a6d10645bd86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Wed, 27 Dec 2023 15:43:54 +0100 Subject: [PATCH] Localizer: fix wrong replacement list -> ensure_list This list was to cast the tuple, it can cause an AttributeError("'tuple' object has no attribute 'append'",) error when this branch is used. This is really an error code path, so that was unnoticed. --- product/Localizer/MessageCatalog.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/product/Localizer/MessageCatalog.py b/product/Localizer/MessageCatalog.py index 8bdf37b926..be1a638120 100644 --- a/product/Localizer/MessageCatalog.py +++ b/product/Localizer/MessageCatalog.py @@ -60,7 +60,6 @@ from .interfaces import IMessageCatalog from .LanguageManager import LanguageManager from .LocalFiles import LocalDTMLFile from .utils import charsets, lang_negotiator, _ -from Products.ERP5Type.Utils import ensure_list ########################################################################### @@ -312,7 +311,7 @@ class MessageCatalog(LanguageManager, ObjectManager, SimpleItem): if lang is None: # Builds the list of available languages # should the empty translations be filtered? - available_languages = ensure_list(self._languages) + available_languages = list(self._languages) # Imagine that the default language is 'en'. There is no # translation from 'en' to 'en' in the message catalog -- 2.30.9