Package: mailman3
Version: 3.2.1-1
Severity: important
Control: tags -1 + patch fixed-upstream
Control: fixed -1 3.3.0
Control: forwarded -1 https://gitlab.com/mailman/mailman/-/issues/625

On a stock buster system, it is impossible to import a mailman2 mailing
list into mailman3, because the `import21` subcommand fails with the
a message like the following:

```
Traceback (most recent call last):
  File "/usr/bin/mailman", line 11, in <module>
    load_entry_point('mailman', 'console_scripts', 'mailman')()
  File "…/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "…/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "…/bin/mailman.py", line 68, in invoke
    return super().invoke(ctx)
  File "…/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "…/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "…/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "…/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "…/mailman/commands/cli_import.py", line 64, in import21
    pickle_file, encoding='utf-8', errors='ignore')
ModuleNotFoundError: No module named 'Mailman'
```

This is serious enough that it prevents anyone from the simplest path to
migrating from mailman2 to mailman3 on a buster system, so i think it
ought to be prioritized for a point release, especially as the
narrowly-targeted fix (attached here) is simple.

This was fixed upstream in 3.3.0.

See upstream fixes (where i extracted this particular fix from):
https://gitlab.com/mailman/mailman/-/commit/2a15437e911660ab87f960ac3a9eba131a2b7350
https://gitlab.com/mailman/mailman/-/commit/6bfe2d3bfa48ee391169eedaf2fbf024f5d7f423

Regards,

        --dkg

commit 2a15437e911660ab87f960ac3a9eba131a2b7350
Author: Abhilash Raj <raj.abhila...@gmail.com>
Date:   Sat Aug 31 15:38:48 2019 -0700

    Add fixes for Python 3.7.4 compatibility.

diff --git a/src/mailman/commands/cli_import.py b/src/mailman/commands/cli_import.py
index cda0bd285..4ebd91363 100644
--- a/src/mailman/commands/cli_import.py
+++ b/src/mailman/commands/cli_import.py
@@ -34,9 +34,13 @@ from zope.component import getUtility
 from zope.interface import implementer
 
 
-# A fake Bouncer class from Mailman 2.1, we don't use it but there are
-# instances in the .pck files.
-class Bouncer:
+# A fake module to go with `Bouncer`.
+class _Mailman:
+    __path__ = 'src/mailman/commands/cli_import.py'
+
+# A fake Mailman object with Bouncer class from Mailman 2.1, we don't use it
+# but there are instances in the .pck files.
+class _Bouncer:
     class _BounceInfo:
         pass
 
@@ -56,7 +60,8 @@ def import21(ctx, listspec, pickle_file):
     if mlist is None:
         ctx.fail(_('No such list: $listspec'))
     with ExitStack() as resources:
-        resources.enter_context(hacked_sys_modules('Mailman.Bouncer', Bouncer))
+        resources.enter_context(hacked_sys_modules('Mailman', _Mailman))
+        resources.enter_context(hacked_sys_modules('Mailman.Bouncer', _Bouncer))
         resources.enter_context(transaction())
         while True:
             try:

Attachment: signature.asc
Description: PGP signature

Reply via email to