After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 771719 - SyntaxError: enable_i18n in autotools_templates/resources/bin/wrapper.py
SyntaxError: enable_i18n in autotools_templates/resources/bin/wrapper.py
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: templates
3.21.x
Other Linux
: Normal critical
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-09-20 12:58 UTC by Jeremy Bicha
Modified: 2016-12-07 00:26 UTC
See Also:
GNOME target: ---
GNOME version: 3.21/3.22



Description Jeremy Bicha 2016-09-20 12:58:30 UTC
Ubuntu GNOME 16.10 Beta with the GNOME3 Staging PPA

While installing gnome-builder, I got this error:
Comment 1 Jeremy Bicha 2016-09-20 12:58:40 UTC
Setting up gnome-builder (3.22.0-1~ubuntu16.10.1~ppa1) ...
  • File "/usr/share/gnome-builder/plugins/autotools_templates/resources/bin/wrapper.py", line 4
    {{if enable_i18n}}
SyntaxError: invalid syntax

  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)
Comment 2 Christian Hergert 2016-09-20 17:38:54 UTC
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.
Comment 3 Michael Biebl 2016-09-20 18:18:17 UTC
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.
Comment 4 Christian Hergert 2016-09-20 18:48:38 UTC
Currently, it should be anything within:

  plugins/autotools-templates/autotools_templates/resources/
Comment 5 Michael Biebl 2016-09-20 19:59:16 UTC
(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.
Comment 6 Felix Schwarz 2016-12-06 10:22:14 UTC
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.
Comment 7 Christian Hergert 2016-12-07 00:26:13 UTC
Great, thanks for following up Felix.