[reportlab-users] issue moving from 3.4.0 to latest

James PK jamespk at reportlab.com
Fri Sep 6 13:14:49 EDT 2019


Thanks for the file. On inspection, I can't investigate much further as 
it is being generated from Dabo. I don't have any knowledge of this 
app/library but more importantly I don't have access to a Dabo 
environment or tools, so you will need to get in contact with their 
developers.

*However - if you want to experiment directly yourself on paragraph.py*, 
then you could add some debugging statements, eg put a print statement 
at line 76;

def _usConv(s, vMap, default=None):
	'''convert a strike/underline distance to a number'''
	import sys;print >>sys.stderr, 20*'=',s,vMap,default

Depending how far you get you could also add print statements in the 
conditional tests of that function, or calling type(my_variable) might 
also be enlightening.


As a side note - you could also generate a small sample paragraph 
directly to prove that a direct call to _usCon() works.

Look at the user guide 
(https://www.reportlab.com/docs/reportlab-userguide.pdf). The base of 
page 69 and top of page 70 has a basic example that would call 
paragraph.py directly. Copy from '
from reportlab...' down to ....doc.build(story)'

By adding in a u tag (which should call _usCon());
-------------------------------------
story.append(Paragraph("<u>This is a paragraph in <i>Normal</i> 
style.</u>",    styleN))
-------------------------------------

You could save the file as para-underline-test.py, then run it in your 
environment;
$ python para-underline-test.py

That sample would generate a file 'mydoc.pdf'. That will should contain 
an underline paragraph; "This is a paragraph in Normal style."


However, I do believe you will need to approach the Dabo 
developers/support next.

Regards,

James


On 06/09/2019 15:48, johnf wrote:
> I should have added that I am using python 3.6.x, on OpenSuse 15.1.
> But I believe the same is happening on windows 10 with python 3.7.x
> 
> I  have attached a file - not sure what I should do to make it simple - 
> I believe there is data at the bottom.
> Johnf
> 
> On 9/6/19 7:13 AM, James PK wrote:
>> > I'm upgrading reportlab from 3.4.0 to 3.5.x issue with _do_post_text()
>>
>> You have upgraded reportlab, I assume that your Python version is 
>> still the same.
>>
>> Is the 'issue' an exception or that the output looks different in 3.5.x?
>>
>>
>> > which is returning a string of zero length ('') and not a number.
>> > I can fix the issue by changing the lw value to 0 (zero).
>>
>> From the repository it looks like _usCon() (added in commit in March 
>> 2018) and it does look like its intention is to return a number.
>>
>>
>> Do you have a slimmed down source file your could email for testing 
>> purposes?
>>
>> James
>>
>>
>>
>> On 06/09/2019 03:13, johnf wrote:
>>>
>>>   Hi everyone,
>>>
>>>
>>>   I'm upgrading reportlab from 3.4.0 to 3.5.x issue with _do_post_text()
>>>
>>> I'm upgrading reportlab from 3.4.0 to 3.5.x and there is a change in 
>>> paragraph.py -> _do_post_text(). In that method there is a line of code:
>>>
>>> lw = _isConv(w,values,default=tx._defaultLineWidth)
>>>
>>> which is returning a string of zero length ('') and not a number. I 
>>> can fix the issue by changing the lw value to 0 (zero).
>>>
>>> But I wonder where I should be looking for the root of the issue???? 
>>> Is it in my rxml file. The file print fine with reportlab 3.4.0.
>>>
>>>
>>> Johnf
>>>
>>>
>>>
>>> _______________________________________________
>>> reportlab-users mailing list
>>> reportlab-users at lists2.reportlab.com
>>> https://pairlist2.pair.net/mailman/listinfo/reportlab-users
>>>
>> _______________________________________________
>> reportlab-users mailing list
>> reportlab-users at lists2.reportlab.com
>> https://pairlist2.pair.net/mailman/listinfo/reportlab-users
> 
> 
> This body part will be downloaded on demand.
> 


More information about the reportlab-users mailing list