GNOME Bugzilla – Bug 771719
SyntaxError: enable_i18n in autotools_templates/resources/bin/wrapper.py
Last modified: 2016-12-07 00:26:13 UTC
Ubuntu GNOME 16.10 Beta with the GNOME3 Staging PPA While installing gnome-builder, I got this error:
Setting up gnome-builder (3.22.0-1~ubuntu16.10.1~ppa1) ...
+ Trace 236686
{{if enable_i18n}}
File "/usr/share/gnome-builder/plugins/autotools_templates/resources/src/__main__.py", line 1 {{include "license.py"}} ^ SyntaxError: invalid syntax dpkg: error processing package gnome-builder (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: gnome-builder E: Sub-process /usr/bin/dpkg returned an error code (1)
It appears that the dpkg packaging hooks are validating files with a filename suffix of .py as valid python before completing the package. These files are templates that will become valid .py files when used by the user, not valid python files pre-expanded. We could consider renaming them to have a .tmpl suffix or something before expansion, but that would create a bit of tedium in our code. If someone wants to put together a patch for that, I'm not against it.
which .py files are templates? Is there a way to distinguish them from real py files? The packaging helper which processes those .py files is dh_python3 and we can exclude files via the -X switch, but for that we need to know which files to exclude.
Currently, it should be anything within: plugins/autotools-templates/autotools_templates/resources/
(In reply to Christian Hergert from comment #4) > Currently, it should be anything within: > > plugins/autotools-templates/autotools_templates/resources/ Ok, this should be easy enough then to exclude in dh_python3. That said, somehow I think using a .tmpl extension would be a better solution.
I think this bug can be closed now as the necessary changes seem to be present in the GNOME3 Staging PPA. More specifically the "rules" file from http://ppa.launchpad.net/gnome3-team/gnome3-staging/ubuntu/pool/main/g/gnome-builder/gnome-builder_3.22.2-1~ubuntu16.10.1.debian.tar.xz contains: override_dh_python3: # https://bugs.debian.org/838342 dh_python3 -X.*/plugins/autotools_templates/resources/.* According to Michael Biebl's comment #5 this should do the trick.
Great, thanks for following up Felix.