Hi gang,
On mailman import21, I hit the error
TypeError: 'pathlib._local.PosixPath' object does not support the context manager protocol
I found the earlier thread, where Mark wrote
This is https://gitlab.com/mailman/mailman/-/issues/1190 fixed for Mailman 3.3.11 by https://gitlab.com/mailman/mailman/-/merge_requests/1309
I have
(venv) mailman@darni:~$ mailman version GNU Mailman 3.3.9 (Tom Sawyer)
I tried
(venv) mailman@darni:~$ pip install -U mailman postorius django-mailman3 hyperkitty mailman-web
to no avail, the TypeError is not fixed and the version is the same.
ok, so I need to spell out a version. Trying
pip install -U mailman==3.3.11 postorius django-mailman3 hyperkitty mailman-web
3.3.11 appears not to be available
pip install -U mailman==3.3.10 postorius django-mailman3 hyperkitty mailman-web
yields the familiar problem with the nntplib.
ERROR: Could not find a version that satisfies the requirement nntplib; python_version >= "3.13" (from mailman) (from versions: none) ERROR: No matching distribution found for nntplib; python_version >= "3.13"
I had earlier gotten around this by installing its successor, standard-nntplib, and it is still there.
(venv) mailman@darni:~$ pip3.13 install standard-nntplib Requirement already satisfied: standard-nntplib in /usr/local/mailman/venv/lib/python3.13/site-packages (3.13.0)
That used to work for 3.3.9. But the 3.3.10 version may have no verbiage to say that the nntlib is replaced by standard-nntplib
Now I seem to have managed to hose my environment.
(venv) mailman@darni:~$ mailman version Traceback (most recent call last): File "/usr/local/mailman/venv/bin/mailman", line 3, in <module> from mailman.bin.mailman import main File "/usr/local/mailman/venv/lib/python3.13/site-packages/mailman/bin/mailman.py", line 25, in <module> from mailman.core.initialize import initialize File "/usr/local/mailman/venv/lib/python3.13/site-packages/mailman/core/initialize.py", line 29, in <module> import mailman.config.config File "/usr/local/mailman/venv/lib/python3.13/site-packages/mailman/config/__init__.py", line 20, in <module> from mailman.config.config import Configuration File "/usr/local/mailman/venv/lib/python3.13/site-packages/mailman/config/config.py", line 32, in <module> from mailman.utilities.modules import call_name, expand_path File "/usr/local/mailman/venv/lib/python3.13/site-packages/mailman/utilities/modules.py", line 23, in <module> from pkg_resources import resource_filename, resource_listdir ModuleNotFoundError: No module named 'pkg_resources'
What now?
-- Written by Thomas Krichel http://openlib.org/home/krichel on his 22213th day.
Thomas Krichel writes
What now?
Actually it looks I could do
pip install -U mailman==3.3.9 postorius django-mailman3 hyperkitty mailman-web
To get back to a working system
But that still leaves me without 3.3.11 which I apparently need for my import21.
-- Written by Thomas Krichel http://openlib.org/home/krichel on his 22213th day.
On 3/29/26 7:57 PM, Thomas Krichel wrote:
Thomas Krichel writes
What now?
Actually it looks I could do
pip install -U mailman==3.3.9 postorius django-mailman3 hyperkitty mailman-web
To get back to a working system
But that still leaves me without 3.3.11 which I apparently need for my import21.
If you do that and it results in a working system, you can then patch mailman/utilities/i18n.py as follows --- 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! However there are other incompatibilities between the released Mailman versions and Python 3.13. At the moment, until updated packages are released, in a Python 3.13 environment it is best to install all of mailman, django-mailman3, postorius, hyperkitty and mailman-web from the heads of the gitlab branches. -- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark Sapiro writes
If you do that and it results in a working system, you can then patch mailman/utilities/i18n.py as follows
Thank you. This works, and I can successfully import a first list configuration.
However there are other incompatibilities between the released Mailman versions and Python 3.13.
Hmm https://docs.mailman3.org/en/latest/install/virtualenv.html states "3.13 is recommended as it is the latest version of Python with which Mailman is tested."
At the moment, until updated packages are released, in a Python 3.13 environment it is best to install all of mailman, django-mailman3, postorius, hyperkitty and mailman-web from the heads of the gitlab branches.
I would love to see a command line for that. When I go to the gitlab page, https://gitlab.com/mailman/, I see a bunch of project that don't immediately correspond to pip package names.
I am sure this would help other folks using 3.13 as they have been recommended to do.
Thanks and cheers!
-- Written by Thomas Krichel http://openlib.org/home/krichel on his 22213th day.
participants (2)
-
Mark Sapiro -
Thomas Krichel