[Debian-astro-maintainers] Bug#1005725: gavodachs2-server: fails to install with new python3-twisted.

peter green plugwash at p10link.net
Sun Feb 13 23:57:56 GMT 2022


Package: gavodachs2-server
Version: 2.5+dfsg-1
Severity: serious
Tags: bookworm, sid

https://ci.debian.net/data/autopkgtest/testing/amd64/g/gavodachs/19190406/log.gz

> Setting up gavodachs2-server (2.5+dfsg-1) ...
> createdb: error: database creation failed: ERROR:  database "gavo" already exists
> Creation of gavo database failed; assuming it's already there
> and carrying on.
> createuser: error: creation of new role failed: ERROR:  role "dachsroot" already exists
> *** Error: Oops.  Unhandled exception AttributeError.
> 
> Exception payload: module 'twisted.web.template' has no attribute
> '_ToStan'
> dpkg: error processing package gavodachs2-server (--configure):
>  installed gavodachs2-server package post-installation script subprocess returned error exit status 1

I attempted to fix that error (debdiff attatched), however it then failed with
a "TypeError: 'Tag' object is not subscriptable", I modified the error handling
to get a backtrace, but it didn't leave me any the wiser as to what the actual
problem was.

Traceback (most recent call last):
   File "/usr/lib/python3/dist-packages/gavo/user/cli.py", line 152, in main
     sys.exit(initdachs.main())
   File "/usr/lib/python3/dist-packages/gavo/user/initdachs.py", line 461, in main
     initDB(dsn)
   File "/usr/lib/python3/dist-packages/gavo/user/initdachs.py", line 433, in initDB
     _importBasicResources()
   File "/usr/lib/python3/dist-packages/gavo/user/initdachs.py", line 405, in _importBasicResources
     from gavo.user import importing
   File "/usr/lib/python3/dist-packages/gavo/user/importing.py", line 14, in <module>
     from gavo import api
   File "/usr/lib/python3/dist-packages/gavo/api.py", line 19, in <module>
     from gavo import rscdesc
   File "/usr/lib/python3/dist-packages/gavo/rscdesc.py", line 27, in <module>
     from gavo import registry
   File "/usr/lib/python3/dist-packages/gavo/registry/__init__.py", line 34, in <module>
     from gavo.registry import oaiinter      # registration of RegistryCore
   File "/usr/lib/python3/dist-packages/gavo/registry/oaiinter.py", line 23, in <module>
     from gavo import svcs
   File "/usr/lib/python3/dist-packages/gavo/svcs/__init__.py", line 35, in <module>
     from gavo.svcs.common import (Error, UnknownURI, ForbiddenURI, WebRedirect,
   File "/usr/lib/python3/dist-packages/gavo/svcs/common.py", line 18, in <module>
     from gavo.formal import nevowc
   File "/usr/lib/python3/dist-packages/gavo/formal/__init__.py", line 22, in <module>
     from .form import Form, Field, Group, ResourceWithForm, FORMS_KEY
   File "/usr/lib/python3/dist-packages/gavo/formal/form.py", line 121, in <module>
     class FieldFragment(nevowc.CommonRenderers, template.Element):
   File "/usr/lib/python3/dist-packages/gavo/formal/form.py", line 127, in FieldFragment
     T.label(class_='label', for_=template.slot('id'))[template.slot('label')],
TypeError: 'Tag' object is not subscriptable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gavodachs-error-handling-hack.diff
Type: text/x-patch
Size: 628 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-astro-maintainers/attachments/20220213/b3813721/attachment.bin>
-------------- next part --------------
diff -Nru gavodachs-2.5+dfsg/debian/changelog gavodachs-2.5+dfsg/debian/changelog
--- gavodachs-2.5+dfsg/debian/changelog	2021-11-17 12:55:14.000000000 +0000
+++ gavodachs-2.5+dfsg/debian/changelog	2022-02-13 23:23:02.000000000 +0000
@@ -1,3 +1,10 @@
+gavodachs (2.5+dfsg-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Adapt code to support new version of twisted.
+
+ -- Peter Michael Green <plugwash at debian.org>  Sun, 13 Feb 2022 23:23:02 +0000
+
 gavodachs (2.5+dfsg-1) unstable; urgency=medium
 
   [ Markus Demleitner ]
diff -Nru gavodachs-2.5+dfsg/debian/patches/series gavodachs-2.5+dfsg/debian/patches/series
--- gavodachs-2.5+dfsg/debian/patches/series	2021-11-17 12:55:14.000000000 +0000
+++ gavodachs-2.5+dfsg/debian/patches/series	2022-02-13 23:23:02.000000000 +0000
@@ -1 +1,2 @@
 0001-Fixing-setup.py-version-check-to-work-with-python-3..patch
+twisted-22.patch
diff -Nru gavodachs-2.5+dfsg/debian/patches/twisted-22.patch gavodachs-2.5+dfsg/debian/patches/twisted-22.patch
--- gavodachs-2.5+dfsg/debian/patches/twisted-22.patch	1970-01-01 00:00:00.000000000 +0000
+++ gavodachs-2.5+dfsg/debian/patches/twisted-22.patch	2022-02-13 23:23:02.000000000 +0000
@@ -0,0 +1,22 @@
+Description:  Adapt code to support new version of twisted.
+Author: Peter Michael Green <plugwash at debian.org>
+
+--- gavodachs-2.5+dfsg.orig/gavo/formal/nevowc.py
++++ gavodachs-2.5+dfsg/gavo/formal/nevowc.py
+@@ -41,8 +41,15 @@ class NoDataError(Exception):
+     """
+     pass
+ 
++#newer versions of twisted moved _ToStan from twisted.web.template to
++#twisted.web._template_util
++try:
++    _ToStan = template._ToStan
++except AttributeError:
++    from twisted.web import _template_util
++    _ToStan = _template_util._ToStan
+ 
+-class _ToStan(template._ToStan):
++class _ToStan(_ToStan):
+     """A SAX parser unifying nevow and twisted.web namespaces.
+ 
+     We also map invisible (nevow) to transparent (t.w).


More information about the Debian-astro-maintainers mailing list