[reportlab-users] Naked ampersand

Paul Keating Paul.Keating at nibc.com
Mon Sep 13 06:47:30 EDT 2010


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

The information contained in this e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail. Please delete this e-mail and do not disclose its contents to any person. NIBC Holding N.V. nor its subsidiaries accept liability for any errors, omissions, delays of receipt or viruses in the contents of this message which arise as a result of e-mail transmission. NIBC Holding N.V. (Chamber of commerce nr. 27282935), NIBC Bank N.V. (Chamber of commerce nr. 27032036) and NIBC Investment Management N.V. (Chamber of commerce nr. 27253909) all have their corporate seat in The Hague, The Netherlands.

De informatie in dit e-mailbericht is vertrouwelijk en uitsluitend bestemd voor de geadresseerde. Wanneer u dit bericht per abuis ontvangt, gelieve onmiddellijk contact op te nemen met de afzender per kerende e-mail. Wij verzoeken u dit e-mailbericht te Vernietigen en de inhoud ervan aan niemand openbaar te maken. NIBC Holding N.V. noch haar dochterondernemingen aanvaarden enige aansprakelijkheid voor onjuiste, onvolledige dan wel ontijdige overbrenging van de inhoud van een verzonden e-mailbericht, noch voor door haar daarbij overgebrachte virussen. NIBC Holding N.V. (KvK nr. 27282935), NIBC Bank N.V. (KvK nr. 27032036) and NIBC Investment Management N.V. (KvK nr. 27253909) zijn statutair gevestigd te Den Haag, Nederland.


More information about the reportlab-users mailing list