pombreda / rst2pdf

Automatically exported from code.google.com/p/rst2pdf
Other
0 stars 0 forks source link

Code block Splitting error(n=2) #454

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Create simple text file with only a code block with a specific text. Or with a 
literal include of a file with the same text.
(See the attached document)

What is the expected output? What do you see instead?
I expect output and no crash log.

I get the following error:
Traceback (most recent call last):
  File "C:\rst2pdf\rst2pdf-0.91\bin\rst2pdf-script.py", line 24, in <module>
    rst2pdf.createpdf.main()
  File "c:\rst2pdf\rst2pdf-0.91\rst2pdf\createpdf.py", line 1446, in main
    compressed=options.compressed)
  File "c:\rst2pdf\rst2pdf-0.91\rst2pdf\createpdf.py", line 639, in createPdf
    pdfdoc.multiBuild(elements)
  File "c:\rst2pdf\rst2pdf-0.91\eggs\reportlab-2.4-py2.7-win32.egg\reportlab\pla
typus\doctemplate.py", line 955, in multiBuild
    self.build(tempStory, **buildKwds)
  File "c:\rst2pdf\rst2pdf-0.91\eggs\reportlab-2.4-py2.7-win32.egg\reportlab\pla
typus\doctemplate.py", line 877, in build
    self.handle_flowable(flowables)
  File "c:\rst2pdf\rst2pdf-0.91\rst2pdf\createpdf.py", line 769, in handle_flowa
ble
    raise LayoutError(ident)
reportlab.platypus.doctemplate.LayoutError: Splitting error(n==2) on page 1 in
<BoundByWidth at 0x2d216e8> containing: [u"<XXPreformatted at 0x2d215f8>test\nte
st\ntest\ntest\ntest\ntest\ntest\ntest\n

Seems to be related to the string:
'Tommy Boy's Greatest Beats The First Fifteen Years nineteen eighty one to 
nineteen ninety six Disc three'

When I add another 'a' to 
the'testaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
' the string the error doesn't occur. It doesn't matter at what line this 
string is, as long as it is before the last. I suspect it has something to do 
with the line length.

* Version of rst2pdf? 0.91

* Version of reportlab? Standard version of 0.91

* Are you using wordaxe, and if true, what version? no

* Are you using rst2pdf with Sphinx, and if true, what version? no

Original issue reported on code.google.com by Geert.Va...@gmail.com on 12 Jun 2012 at 1:48

Attachments:

GoogleCodeExporter commented 9 years ago
I've seen the same error on some of my documentation, since I'm building pdf's 
with rst2pdf.

Is anyone going to fix this?

Original comment by s...@lovelysystems.com on 4 Jul 2012 at 11:49

GoogleCodeExporter commented 9 years ago
Yes.

Original comment by roberto.alsina on 4 Jul 2012 at 12:40

GoogleCodeExporter commented 9 years ago
Roberto,

Let me know if you need any additional data or test-files.

Original comment by s...@lovelysystems.com on 4 Jul 2012 at 1:44

GoogleCodeExporter commented 9 years ago
Is the same error?

Any long string such as ``C:\Documents and Settings\<user name>\Application 
Data\Example\Example\<application version>\Security`` 

results in: 

[WARNING] flowables.py:727 BoundByWidth too wide to fit in frame (600.0 > 456.68
976378): <BoundByWidth at 0x4488ac8L> containing: [u'<XXPreformatted at 0x4480a4
8L>iNSERT STRING HERE

Original comment by ben.rog...@gmail.com on 23 Jul 2012 at 10:58

GoogleCodeExporter commented 9 years ago
I have the same error here. It seems it is not related to the length of the 
sentence but to something else but I cannot figure out what's the problem in my 
file (it is quite long, and it appeared when I migrated from 0.16 to 0.92).

Traceback (most recent call last):
  File "/usr/local/bin/rst2pdf", line 9, in <module>
    load_entry_point('rst2pdf==0.92', 'console_scripts', 'rst2pdf')()
  File "/usr/local/lib/python2.7/dist-packages/rst2pdf-0.92-py2.7.egg/rst2pdf/createpdf.py", line 1449, in main
    compressed=options.compressed)
  File "/usr/local/lib/python2.7/dist-packages/rst2pdf-0.92-py2.7.egg/rst2pdf/createpdf.py", line 642, in createPdf
    pdfdoc.multiBuild(elements)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 960, in multiBuild
    self.build(tempStory, **buildKwds)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 880, in build
    self.handle_flowable(flowables)
  File "/usr/local/lib/python2.7/dist-packages/rst2pdf-0.92-py2.7.egg/rst2pdf/createpdf.py", line 772, in handle_flowable
    raise LayoutError(ident)
reportlab.platypus.doctemplate.LayoutError: Splitting error(n==2) on page 73 in
<BoundByWidth at 0x68c8b48> containing: [u'<XXPreformatted at 0x66e88c0>public 
class GivePhoneNumber extends Activity {\

Original comment by jfl.lala...@gmail.com on 14 Oct 2012 at 7:23

GoogleCodeExporter commented 9 years ago
I am getting this all the time. Work around is to rearrange the vertical flow 
of the text. I believe this is because the troublesome page split will not 
happen any more at the middle of the code blocks (not sure if the terminology 
is correct - I mean the indented text after "::").

I just "fixed" an error of this kind in my document by inserting table of 
contents at the beginning of file. Sometimes I have inserted page breaks before 
the troubling code section. Sometimes I have splitted longer code blocks to 
smaller pieces. But it has happened sometimes that when I "fix" an error of 
this kidn, it pops up elsewhere in the document; especially if I have many code 
blocks and they are longer. This is big nuisance in the otherwise beautiful 
program!!!

bash$ rst2pdf -v VoIP_Log_Functionality_Proposal.rst 
[INFO] createpdf.py:1535 Importing extension module 'vectorpdf'
[INFO] languages.py:39 Language 'en_US' not supported by Docutils, using 'en' 
instead.
[INFO] styles.py:82 Using stylesheets: 
[INFO] styles.py:110 
FontPath:['/usr/local/lib/python2.7/dist-packages/rst2pdf-0.92.dev_r2536-py2.7.e
gg/rst2pdf/fonts', '.']
[INFO] styles.py:111 
StylePath:['/usr/local/lib/python2.7/dist-packages/rst2pdf-0.92.dev_r2536-py2.7.
egg/rst2pdf/styles', '/home/fo/.rst2pdf/styles', '.']
[INFO] languages.py:39 Language 'en_US' not supported by Docutils, using 'en' 
instead.
[INFO] createpdf.py:640 Starting build
Traceback (most recent call last):
  File "/usr/local/bin/rst2pdf", line 9, in <module>
    load_entry_point('rst2pdf==0.92.dev-r2536', 'console_scripts', 'rst2pdf')()
  File "/usr/local/lib/python2.7/dist-packages/rst2pdf-0.92.dev_r2536-py2.7.egg/rst2pdf/createpdf.py", line 1458, in main
    compressed=options.compressed)
  File "/usr/local/lib/python2.7/dist-packages/rst2pdf-0.92.dev_r2536-py2.7.egg/rst2pdf/createpdf.py", line 642, in createPdf
    pdfdoc.multiBuild(elements)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 960, in multiBuild
    self.build(tempStory, **buildKwds)
  File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 880, in build
    self.handle_flowable(flowables)
  File "/usr/local/lib/python2.7/dist-packages/rst2pdf-0.92.dev_r2536-py2.7.egg/rst2pdf/createpdf.py", line 772, in handle_flowable
    raise LayoutError(ident)
reportlab.platypus.doctemplate.LayoutError: Splitting error(n==2) on page 1 in
<BoundByWidth at 0x2d15758> containing: [u'<XXPreformatted at 
0x2d154d0>[13:08:34.323][7] [MSG] Send to 10.16.0.4:5060 

Original comment by moili...@gmail.com on 3 Dec 2012 at 6:34

GoogleCodeExporter commented 9 years ago
I agree with you: it seems to happen for no reason. The problem is that in a 
long document it is not so easy to push the text to make this error disappear. 

It is also difficult to reproduce this bug because it needs a long document to 
make this appear. Have you any simple sample to submit to help devs reproduce 
the bug ?

Original comment by jfl.lala...@gmail.com on 3 Dec 2012 at 7:53

GoogleCodeExporter commented 9 years ago
Yes, this bug is what's blocking a rst2pdf release.
I can reproduce it allright (the rst2pdf manual itself fails), I just have not 
had enough time or luck debugging it :-(

Original comment by roberto.alsina on 3 Dec 2012 at 11:04

GoogleCodeExporter commented 9 years ago
THis bug is caused by r2406

Original comment by roberto.alsina on 5 Dec 2012 at 2:22

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2540.

Original comment by roberto.alsina on 6 Dec 2012 at 2:00

GoogleCodeExporter commented 9 years ago
Issue 456 has been merged into this issue.

Original comment by roberto.alsina on 7 Dec 2012 at 10:10

GoogleCodeExporter commented 9 years ago
I can confirm that this bug is SOLVED :)

Thank you a lot for spending time on this issue !

Original comment by jfl.lala...@gmail.com on 7 Dec 2012 at 2:11