#2033 Bodhi: can't view pidgin-sipe-1.9.0-1 updates
Closed: Fixed None Opened 9 years ago by thoger.

= phenomenon =
Attempt to access pidgin-sipe-1.9.0-1 update requests for 11/12/13 always results in 500 Internal Error:

https://admin.fedoraproject.org/updates/pidgin-sipe-1.9.0-1.fc11 / .fc12 / .fc13

Whether I'm logged in or not does not seem to make a difference. Older update requests for the same package are accessible. I've not seen this problem with any other update request.


This looks like it is a bug in the new markdown renderer...

{{{
reg = re.compile(r'(^[-] .(?:\n[-] .)*)', re.MULTILINE)
notes = markdown(reg.sub(r'\n\1\n', escape(update.notes)))
}}}

Which turns these notes:

{{{
u'version 1.9.0 "File transfer & NTLMv2" (2010-03-10)\r\n* Important Security Update for nix users **\r\n - Contributed File transfer functionality. File encryption is supported\r\n - NTLMv2 and NTLMv2 Session Security support (pier11)\r\n - Implemented SIP Authentication Extensions protocol version 4 and 3 (p\r\n - Adoption for commercial UNIX - HP/UX, Irix, Solaris - big endian fixe\r\n - Packaged for Maemo platform (Nokia N900, etc.) at Maemo.org. Works wi\r\n - Adoption of file transfer for Windows build (pier11)\r\n - Official Debian package files in contrib (Anibal Avelar)\r\n - another shot at presence update problems (Stefan Becker)\r\n - fix crash caused by uninitialized security contexts (Stefan Becker)\r\n - Code analysis with Coverity Prevent. (Stefan Becker)\r\n - Updated translations: \'ru\' (100%, pier11), \'de\' (100%, Stefan Becker)\r\n \'es\' & \'pt_BR\' (100%, Anibal Avelar)\r\n - Fix for "SIP/2.0 481 Call leg unavailable" error (Anibal Avelar)\r\n - Increased libpurple build requisite to >= 2.4.0\r\n'
}}}

into:

{{{
u'

version 1.9.0 "File transfer & NTLMv2" (2010-03-10)\n Important Security Update for *nix users \n - Contributed File transfer functionality. File encryption is supported\n - NTLMv2 and NTLMv2 Session Security support (pier11)\n - Implemented SIP Authentication Extensions protocol version 4 and 3 (p\n - Adoption for commercial UNIX - HP/UX, Irix, Solaris - big endian fixe\n - Packaged for Maemo platform (Nokia N900, etc.) at Maemo.org. Works wi\n - Adoption of file transfer for Windows build (pier11)\n - Official Debian package files in contrib (Anibal Avelar)\n - another shot at presence update problems (Stefan Becker)\n - fix crash caused by uninitialized security contexts (Stefan Becker)\n - Code analysis with Coverity Prevent. (Stefan Becker)\n - Updated translations: \'ru\' (100%, pier11), \'de\' (100%, Stefan Becker)\n \'es\' & \'pt_BR\' (100%, Anibal Avelar)\n - Fix for "SIP/2.0 481 Call leg unavailable" error (Anibal Avelar)\n - Increased libpurple build requisite to >= 2.4.0

\n'
}}}

which triggers:

{{{
File "/usr/lib/python2.4/site-packages/kid/parser.py", line 372, in _expat_stream
feed(data)
File "/usr/lib/python2.4/site-packages/kid/parser.py", line 434, in feed
raise expat.ExpatError(e)
ExpatError: Error parsing XML:
Important Securi
^
mismatched tag: line 2, column 14
Error location in template file '/usr/lib/python2.4/site-packages/bodhi/templates/show.kid'
between line 233, column 29 and line 234, column 4:
...
}}}

I assume kid doesn't like the '', where the tags are not at the same level?

Ok, so I modified the notes by hand to get them working again... the problem was that you had '** Important blah blah **'. I fixed it by turning it into 'Important', which got it working again.

I'm not a markdown expert, so I CC'd bochecha, who added the markdown support to bodhi, who can hopefully help us figure out how to fix this properly.

The problem is that in the Markdown syntax:
{{{
bold and italic
}}}
is rendered as:
'''bold''' and ''italic''

So when you write {{{*}}} you get the {{{}}} tags.

Kid validates the XML, and it's obviously not valid.

In such a case, I think the Markdown parser ({{{python-markdown2}}} module) should be able to cope and not generate invalid markup. It could interpret this as {{{ Important }}} or:
''''' Important '''''

As an example, this is what Trac does with it's wiki markup:
{{{
'''''''' Important ''''''''
}}}
is rendered as {{{ Important }}}. Trac actually adds the closing tags when it has to, so that's another possibility.

So to me, that's a bug in {{{python-markdown2}}}. I'll try to see if I can fix this, and I'll at least open a bug in the upstream tracker.

I just pushed a fix for this issue in Bodhi.

More details in an email I sent to the Bodhi mailing-list and in the commit message:
* https://fedorahosted.org/pipermail/bodhi/2010-March/000305.html
* https://fedorahosted.org/bodhi/changeset/5ae630fd7295de99932b071ccfea391b3e1c8f1a

This issue has been resolved.

Login to comment on this ticket.

Metadata