I set up a new Mailman site using 3.3.10, and copied over my files from my old mailman site (using 2.1.34). I created a new domain, and a new list, and tried to import the settings from the old pickle file using mailman import21 pt-test@browncroftna.org /var/tmp/var.lib.mailman/lists/pt-test/config.pck (in the virtual environment shell) but I get the following error
File "/opt/mailman/venv/lib/python3.13/site-packages/mailman/utilities/importer.py", line 512, in import_config_pck
default_value = getUtility(ITemplateLoader).get(newvar, mlist)
File "/opt/mailman/venv/lib/python3.13/site-packages/mailman/model/template.py", line 211, in get
path, fp = find(default_uri, mlist, code)
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/mailman/venv/lib/python3.13/site-packages/mailman/utilities/i18n.py", line 157, in find
for search_path in raw_search_order:
^^^^^^^^^^^^^^^^
File "/opt/mailman/venv/lib/python3.13/site-packages/mailman/utilities/i18n.py", line 117, in search
templates_dir = str(resources.enter_context(
~~~~~~~~~~~~~~~~~~~~~~~^
files('mailman').joinpath('templates')))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/contextlib.py", line 528, in enter_context
raise TypeError(f"'{cls.__module__}.{cls.__qualname__}' object does "
f"not support the context manager protocol") from None
TypeError: 'pathlib._local.PosixPath' object does not support the context manager protocol
All I can find on Google is a suggestion that I have a non-empty bounce_info, but dumpdb shows it as empty.
On 2/22/26 14:53, Paul Tomblin via Mailman-users wrote:
I set up a new Mailman site using 3.3.10, and copied over my files from my old mailman site (using 2.1.34). I created a new domain, and a new list, and tried to import the settings from the old pickle file using mailman import21 pt-test@browncroftna.org /var/tmp/var.lib.mailman/lists/pt-test/config.pck (in the virtual environment shell) but I get the following error
File "/usr/lib/python3.13/contextlib.py", line 528, in enter_context raise TypeError(f"'{cls.__module__}.{cls.__qualname__}' object does " f"not support the context manager protocol") from None TypeError: 'pathlib._local.PosixPath' object does not support the context manager protocol
There is a compatibility issue between Mailman <=3.3.10 and Python 3.13. See <https://gitlab.com/mailman/mailman/-/issues/1190> and <https://gitlab.com/mailman/mailman/-/merge_requests/1309>. This patch will fix your issue. ``` --- a/src/mailman/utilities/i18n.py +++ b/src/mailman/utilities/i18n.py @@ -114,8 +114,7 @@ def search(resources, template_file, mlist=None, language=None): languages.append(language) languages.reverse() # The non-language qualified $template_dir paths in search order. - templates_dir = str(resources.enter_context( - files('mailman').joinpath('templates'))) + templates_dir = str(files('mailman').joinpath('templates')) paths = [templates_dir, os.path.join(config.TEMPLATE_DIR, 'site')] if mlist is not None: # Don't forget these are in REVERSE search order! ``` -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Mark Sapiro -
Paul Tomblin