Merge lp:~cjwatson/launchpad/disable-pot-generation into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18453
Proposed branch: lp:~cjwatson/launchpad/disable-pot-generation
Merge into: lp:launchpad
Diff against target: 64 lines (+5/-12)
3 files modified
Makefile (+5/-2)
buildout.cfg (+0/-9)
versions.cfg (+0/-1)
To merge this branch: bzr merge lp:~cjwatson/launchpad/disable-pot-generation
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+330157@code.launchpad.net

Commit message

Disable launchpad.pot generation for now; it hasn't worked for some time, and obstructs converting the build system to pip.

Description of the change

Without modifications:

  $ make potemplates
  bin/i18nextract.py
  make: bin/i18nextract.py: Command not found
  Makefile:421: recipe for target 'launchpad.pot' failed
  make: *** [launchpad.pot] Error 127

With the obvious fix:

  $ make potemplates
  bin/i18nextract
  domain: 'launchpad'
  configuration: /home/cjwatson/src/canonical/launchpad/lp-branches/disable-pot-generation/parts/i18n/configure.zcml
  exclude dirs: []
  include default domain: True
  python only: False
  verify domain: False
  header template: None

  package: 'lp'
  base: '/home/cjwatson/src/canonical/launchpad/lp-branches/disable-pot-generation/lib/'
  path: '/home/cjwatson/src/canonical/launchpad/lp-branches/disable-pot-generation/lib/lp'

  There was an error processing /home/cjwatson/src/canonical/launchpad/lp-branches/disable-pot-generation/lib/lp/registry/templates/person-rdf-contents.pt
  Traceback (most recent call last):
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.app.locales-3.6.2-py2.7.egg/zope/app/locales/extract.py", line 525, in tal_strings
      p.parseFile(filename)
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/htmltalparser.py", line 122, in parseFile
      self.parseString(data)
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/htmltalparser.py", line 128, in parseString
      self.feed(data)
    File "/usr/lib/python2.7/HTMLParser.py", line 117, in feed
      self.goahead(0)
    File "/usr/lib/python2.7/HTMLParser.py", line 161, in goahead
      k = self.parse_starttag(i)
    File "/usr/lib/python2.7/HTMLParser.py", line 327, in parse_starttag
      self.handle_starttag(tag, attrs)
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/htmltalparser.py", line 156, in handle_starttag
      self.getpos())
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.tal-3.5.2-py2.7.egg/zope/tal/talgenerator.py", line 489, in emitStartElement
      raise TALError("bad TAL attribute: " + `key`, position)
  TALError: bad TAL attribute: 'xmlns:rdf', at line 1, column 1, in file /home/cjwatson/src/canonical/launchpad/lp-branches/disable-pot-generation/lib/lp/registry/templates/person-rdf-contents.pt
  Traceback (most recent call last):
    File "bin/i18nextract", line 34, in <module>
      '-p', 'lp'
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/z3c.recipe.i18n-0.8.1-py2.7.egg/z3c/recipe/i18n/i18nextract.py", line 257, in main
      maker.write()
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/z3c.recipe.i18n-0.8.1-py2.7.egg/z3c/recipe/i18n/i18nextract.py", line 108, in write
      entry.write(file)
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.app.locales-3.6.2-py2.7.egg/zope/app/locales/extract.py", line 125, in write
      file.write('msgid %s\n' % normalize(self.msgid))
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.app.locales-3.6.2-py2.7.egg/zope/app/locales/pygettext.py", line 235, in normalize
      s = '"' + escape(s) + '"'
    File "/home/cjwatson/src/canonical/launchpad/lp-sourcedeps/eggs/zope.app.locales-3.6.2-py2.7.egg/zope/app/locales/pygettext.py", line 221, in escape
      s[i] = escapes[ord(s[i])]
  IndexError: list index out of range
  Makefile:421: recipe for target 'launchpad.pot' failed
  make: *** [launchpad.pot] Error 1

I didn't see an obvious fix for this at first glance, so let's remove this from the build system for the time being, since z3c.recipe.i18n requires buildout and that was going to require a moderate amount of reworking anyway in order to convert to pip. We can always add something similar back later if necessary.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) wrote :

what will we ever do

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2017-05-11 14:15:36 +0000
3+++ Makefile 2017-09-04 12:38:46 +0000
4@@ -50,7 +50,6 @@
5 $(PY) bin/apiindex bin/bzr bin/combine-css bin/fl-build-report \
6 bin/fl-credential-ctl bin/fl-install-demo bin/fl-monitor-ctl \
7 bin/fl-record bin/fl-run-bench bin/fl-run-test bin/googletestservice \
8- bin/i18ncompile bin/i18nextract bin/i18nmergeall bin/i18nstats \
9 bin/harness bin/iharness bin/ipy bin/jsbuild bin/lpjsmin\
10 bin/killservice bin/kill-test-services bin/retest \
11 bin/run bin/run-testapp bin/sprite-util bin/start_librarian \
12@@ -417,8 +416,12 @@
13 potemplates: launchpad.pot
14
15 # Generate launchpad.pot by extracting message ids from the source
16+# XXX cjwatson 2017-09-04: This was previously done using i18nextract from
17+# z3c.recipe.i18n, but has been broken for some time. The place to start in
18+# putting this together again is probably zope.app.locales.
19 launchpad.pot:
20- bin/i18nextract.py
21+ echo "POT generation not currently supported; help us fix this!" >&2
22+ exit 1
23
24 # Called by the rocketfuel-setup script. You probably don't want to run this
25 # on its own.
26
27=== modified file 'buildout.cfg'
28--- buildout.cfg 2017-05-12 10:04:55 +0000
29+++ buildout.cfg 2017-09-04 12:38:46 +0000
30@@ -6,7 +6,6 @@
31 scripts
32 tags
33 iharness
34- i18n
35 txlongpoll
36 txpkgupload
37 unzip = true
38@@ -69,14 +68,6 @@
39 recipe = z3c.recipe.tag:tags
40 eggs = lp
41
42-[i18n]
43-recipe = z3c.recipe.i18n:i18n
44-eggs = lp
45-packages = lp
46-domain = launchpad
47-output = locales
48-zcml = <include file="../../zcml/webapp.zcml" />
49-
50 [txlongpoll]
51 recipe = z3c.recipe.scripts
52 eggs = ${scripts:eggs}
53
54=== modified file 'versions.cfg'
55--- versions.cfg 2017-09-04 10:13:29 +0000
56+++ versions.cfg 2017-09-04 12:38:46 +0000
57@@ -149,7 +149,6 @@
58 wsgiref = 0.1.2
59 z3c.pt = 2.2.3
60 z3c.ptcompat = 0.5.7
61-z3c.recipe.i18n = 0.8.1
62 z3c.recipe.tag = 0.6
63 # Also upgrade the zc.buildout version in the Makefile's bin/buildout section.
64 zc.buildout = 1.7.1