[reportlab-users] errors parsing & > in paragraphs

John Pywtorak jpywtora at calpoly.edu
Tue Oct 18 20:04:41 EDT 2005


Timothy Smith wrote:
> Andy Robinson wrote:
> 
>>> it appears ther emight be some kind of inconsistency between the
>>> windows and source release? can anyone verify this by testing it.
>>>   
>>
>>
>>  
>>
>>> my freebsd installation simply chops out the & (also not really
>>> desirable) but windows actually errors
>>>
>>>   
>>
>>
>> If they are different the most likely case is that you have
>> a difference in which extensions are installed.  Can you do
>> 'import pyRXP' and 'import _rl_accel' in both?  In an ideal
>> world the pure python implementation should do the same as the C ones,
>> but it probably didn't at that time, and I suspect you have
>> an extension in one which is not in the other.
>>
>> IMHO a paragraph with naked >,  and & SHOULD cause an error, because
>> paragraph source has always been treated as XML and there are
>> lots of genuine tags you can embed.  But we were not strict about it
>> so usage has varied. 
>> The daily builds, which are a long way past 1.20 now, have had
>> all of this reworked extensively and should fix the problem.
>> We're long overdue for a 1.21 release, although project pressures
>> mean it will be nearer the end of the year.
>>
>> Best Regards,
>>
>> Andy
>> _______________________________________________
>>  
>>
> ok i got the lastest stable out of svn and it still errors when
> attempting to parse & in a paragraph. do i need to write a function to
> escape this? it's a little annoying that i have to be escaping
> characters, since now i don't know what else i might need to escape
> _______________________________________________

>From a prior post by Robin Becker I quote:
"you can escape all the < & > fairly easily. eg

fld=fld.replace('&','&amp;').replace('<','&lt;').replace('>','&gt;')"

I originally used a slightly less compact form and thought this was nice.

-- 
Windows
Start Here
Frustrating Hanging Crashing
Blue Screen of Death
Reboot



More information about the reportlab-users mailing list