Modify

Ticket #221 (closed task: invalid)

Opened 6 years ago

Last modified 3 years ago

minor code syntax error on <link> tags in ATVideo

Reported by: datakid Owned by: andycat
Priority: trivial Milestone: 4.9
Component: ATVideo Severity:
Keywords: Cc:
Who will test this: And

Description

When creating the pot translation files for ATVideo, i18ndude (the translation string extractor) fails for ATVideo with the following errors:

$i18ndude rebuild-pot --pot $atvidedo.pot --create $plone .

There was an error processing ./skins/ATEngageVideo/RSS2.pt
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/i18ndude-3.0-py2.4.egg/i18ndude/extract.py", line 476, in tal_strings
    p.parseFile(filename)
  File "/usr/lib/python2.4/site-packages/zope.tal-3.5.0-py2.4.egg/zope/tal/htmltalparser.py", line 122, in parseFile
    self.parseString(data)
  File "/usr/lib/python2.4/site-packages/zope.tal-3.5.0-py2.4.egg/zope/tal/htmltalparser.py", line 128, in parseString
    self.feed(data)
  File "/usr/lib/python2.4/HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "/usr/lib/python2.4/HTMLParser.py", line 148, in goahead
    k = self.parse_starttag(i)
  File "/usr/lib/python2.4/HTMLParser.py", line 268, in parse_starttag
    self.handle_starttag(tag, attrs)
  File "/usr/lib/python2.4/site-packages/zope.tal-3.5.0-py2.4.egg/zope/tal/htmltalparser.py", line 147, in handle_starttag
    self.getpos())
TALError: empty HTML tags cannot use tal:content: 'link', at line 32, column 9, in file ./skins/ATEngageVideo/RSS2.pt
There was an error processing ./browser/templates/rss_template.pt
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/i18ndude-3.0-py2.4.egg/i18ndude/extract.py", line 476, in tal_strings
    p.parseFile(filename)
  File "/usr/lib/python2.4/site-packages/zope.tal-3.5.0-py2.4.egg/zope/tal/htmltalparser.py", line 122, in parseFile
    self.parseString(data)
  File "/usr/lib/python2.4/site-packages/zope.tal-3.5.0-py2.4.egg/zope/tal/htmltalparser.py", line 128, in parseString
    self.feed(data)
  File "/usr/lib/python2.4/HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "/usr/lib/python2.4/HTMLParser.py", line 148, in goahead
    k = self.parse_starttag(i)
  File "/usr/lib/python2.4/HTMLParser.py", line 268, in parse_starttag
    self.handle_starttag(tag, attrs)
  File "/usr/lib/python2.4/site-packages/zope.tal-3.5.0-py2.4.egg/zope/tal/htmltalparser.py", line 147, in handle_starttag
    self.getpos())
TALError: empty HTML tags cannot use tal:content: 'link', at line 26, column 3, in file ./browser/templates/rss_template.pt

On failure, i18ndude fails to create a pot file. Note that I have also tried this with the newer version of i18ndude (that uses python2.5) and it similarly fails.

I looked into these two files and they have other instances of link tags with tal:content - it's only failing on the first instance.

Neither of these files have any strings to translate, so I tried deleting them and running i18ndude again with success.

Is replacing these "link" tags with "a" tags a working solution?

#plone suggested I look at the  definition of a link tag which was very clarifying, which is why I suggest the "a" tag solution

Attachments

Change History

comment:1 Changed 6 years ago by datakid

sorry, that last line should read "which wasn't very clarifying"

comment:2 Changed 5 years ago by vik

The issue is that RSS is XML, and one of the elements is a non-empty link tag e.g. <link> http://foo.bar/baz</link> HTML, on the other hand uses only _empty_ link tags e.g. <link rel="foo" /> Non-empty link tags in HTML are forbidden.

i18ndude (via some TAL library) is trying to parse the .pt file as and HTML file, and the parser is failing on the non-empty link tag.

A temporary workaround is to change the <link> </link> tags to something else (e.g. linka) for the purposes of running i18ndude, then reverting them back to link.

comment:3 Changed 4 years ago by and

  • Milestone changed from 3.4 to 3.3

Milestone 3.4 deleted

comment:4 Changed 4 years ago by and

  • Status changed from new to closed
  • Resolution set to invalid
  • Who will test this set to And

comment:5 Changed 3 years ago by and

  • Milestone changed from 4.6 Beta (New Features and Fixes) to 4.7 Beta

Milestone 4.6 Beta (New Features and Fixes) deleted

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.