[reportlab-users] Naked ampersand

Robin Becker robin at reportlab.com
Tue Sep 14 06:40:46 EDT 2010


On 13/09/2010 11:47, Paul Keating wrote:

> I ran the test suite on the newly installed 64-bit version (revision 3520) and ran into a snag that I had hit earlier with my own integration testing: platypus.paragraph.Paragraph() chokes on a text string with& in it:

>

> ERROR: testNakedAmpersands (test_platypus_paraparser.ParaParserTestCase)

> ----------------------------------------------------------------------

> Traceback (most recent call last):

> File "C:\Python26\Lib\site-packages\reportlab\tests\test_platypus_paraparser.py", line 115, in testNakedAmpersands

> p = Paragraph(txt, self.style)

> File "c:\python26\lib\site-packages\reportlab\platypus\paragraph.py", line 805, in __init__

> self._setup(text, style, bulletText, frags, cleanBlockQuotedText)

> File "c:\python26\lib\site-packages\reportlab\platypus\paragraph.py", line 823, in _setup

> % (_parser.errors[0],text[:min(30,len(text))]))

> ValueError: xml parser error (bogus< or&) in paragraph beginning '1& 2'

>

> I had already fixed my programs to deliver&amp; instead, but seeing this test fail made me realize I shouldn't have to do that, because going by the name, the test clearly expects it to work.

>

> Three test modules trip up on this: test_paragraphs, test_platypus_index, text_platypus_paragraphs.

>

> Paul Keating

>


hmmh, this certainly works on my win32 box and I thought it did last time I ran
the tests on a 64bit win-amd64 VM. I'll try and check out the very latest code
today and see what happens.
--
Robin Becker


More information about the reportlab-users mailing list