mailman3-web 0+20200530-2.1 fails to install

Bug #2060276 reported by Marco van Zwetselaar
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mailman-suite (Ubuntu)
New
Undecided
Unassigned

Bug Description

Installing mailman3-web on mantic fails with:

  File "/usr/share/mailman3-web/urls.py", line 20, in <module>
    from django.conf.urls import include, url
ImportError: cannot import name 'url' from 'django.conf.urls' (/usr/lib/python3/dist-packages/django/conf/urls/__init__.py)
dpkg: error processing package mailman3-web (--configure):
 installed mailman3-web package post-installation script subprocess returned error exit status 1

The error is due to deprecation of url in django.conf.urls, see here: https://github.com/Tivix/django-rest-auth/issues/659

The fix is to replace it with re_path from django.urls. Patch for /usr/share/mailman3-web/urls.py is attached.

Tags: mantic patch
Revision history for this message
Marco van Zwetselaar (zwets) wrote :
Revision history for this message
Marco van Zwetselaar (zwets) wrote :

There is an even less invasive fix, namely to use 'import as' and import re_path as url:

--- /usr/share/mailman3-web/urls.py.orig 2024-04-05 07:56:38.119113883 +0000
+++ /usr/share/mailman3-web/urls.py 2024-04-05 08:09:09.912489281 +0000
@@ -17,7 +17,8 @@
 # Postorius. If not, see <http://www.gnu.org/licenses/>.

-from django.conf.urls import include, url
+from django.conf.urls import include
+from django.urls import re_path as url
 from django.contrib import admin
 from django.urls import reverse_lazy
 from django.views.generic import RedirectView

Revision history for this message
Marco van Zwetselaar (zwets) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "mailman3-web.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.