pombreda / rst2pdf

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

ValueError: Unknown color u'black' / Ubuntu 9.04 Problems #195

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
rst2pdf is working great so far and I love it, but I've been running into
my fair share of problems unfortunately :(

Here's what I've found:

a) Can't compile a popular ReST Cheetsheet (I guess would make a good acid
type test :)

b) Test suite fails on Python 2.6 and 2.5

c) Ubuntu 9.04 universe comes with rst2pdf 0.9 which generates the
following error "AttributeError: Table instance has no attribute 'style'"
which I believe has been fixed by you guys already so I had to easy_install
the latest.

What steps will reproduce the problem?

$ easy_install rst2pdf
$ wget http://docutils.sourceforge.net/docs/user/rst/cheatsheet.txt
$ mkdir images
$ cp /where/did/i/go/biohazard.png images
$ rst2pdf -v cheetsheet.txt

What is the expected output? What do you see instead?

jart@compy:~/Documents$ rst2pdf -v ReST-cheatsheet.txt 
[INFO] styles.py:44 Using stylesheets:
/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11-py2.6.egg/rst2pdf/styles/sty
les.json,/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11-py2.6.egg/rst2pdf/s
tyles/default.json
[INFO] styles.py:60 FontPath:['.',
'/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11-py2.6.egg/rst2pdf/fonts']
[INFO] styles.py:61 StylePath:['.',
'/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11-py2.6.egg/rst2pdf/styles',
'/home/jart/.rst2pdf/styles']
[WARNING] createpdf.py:258 Using image images/biohazard.png without
specifying size.Calculating based on image size at 96dpi
[INFO] createpdf.py:280 Image images/biohazard.png size calculated: 
0.423333cm by 0.423333cm
Traceback (most recent call last):
  File "/usr/local/bin/rst2pdf", line 8, in <module>
    load_entry_point('rst2pdf==0.11', 'console_scripts', 'rst2pdf')()
  File
"/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11-py2.6.egg/rst2pdf/createpdf
.py",
line 1651, in main
    compressed=options.compressed)
  File
"/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11-py2.6.egg/rst2pdf/createpdf
.py",
line 1297, in createPdf
    pdfdoc.multiBuild(elements)
  File
"/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line
855, in multiBuild
    self.build(tempStory, filename, canvasmaker)
  File
"/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line
777, in build
    self.handle_flowable(flowables)
  File
"/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line
665, in handle_flowable
    if frame.add(f, canv, trySplit=self.allowSplitting):
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/frames.py",
line 174, in _add
    flowable.drawOn(canv, self._x + self._leftExtraIndent, y, _sW=aW-w)
  File
"/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11-py2.6.egg/rst2pdf/flowables
.py",
line 189, in drawOn
    self.t.drawOn(canvas, x, y, _sW)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/flowables.py",
line 105, in drawOn
    self._drawOn(canvas)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/flowables.py",
line 89, in _drawOn
    self.draw()#this is the bit you overload
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/tables.py",
line 1295, in draw
    self._drawLines()
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/tables.py",
line 1019, in _drawLines
    getattr(self,_LineOpMap.get(op, '_drawUnknown' ))( (sc, sr), (ec, er),
weight, color, count, space)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/tables.py",
line 1040, in _drawInnerGrid
    self._drawHLines((sc, sr+1), (ec, er), weight, color, count, space)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/tables.py",
line 1055, in _drawHLines
    self._prepLine(weight, color)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/tables.py",
line 1045, in _prepLine
    self.canv.setStrokeColor(color)
  File "/usr/lib/python2.6/dist-packages/reportlab/pdfgen/textobject.py",
line 98, in setStrokeColor
    raise ValueError('Unknown color %r' % aColor)
ValueError: Unknown color u'black'

What version of the product are you using? On what operating system?

Ubuntu 9.04 (jaunty)

jart@compy:~/Desktop/rst2pdf-0.11$ pip freeze | grep  -ie docutils -ie
sphinx -ie  wordaxe -ie PIL -ie  PythonMagick -ie svglib -ie uniconvertor
-ie pypdf

PIL==1.1.6
Sphinx==0.5.2
SphinxBase==0.4.1
UniConvertor==1.1.3
docutils==0.5
pyPdf==1.12
wordaxe==0.3.0

Thanks in advance for your help everyone!

Original issue reported on code.google.com by jtunney@gmail.com on 15 Sep 2009 at 3:51

GoogleCodeExporter commented 9 years ago
Argh, the infamous Unknown color u'black' bug again!

I have never been able to reproduce it, but there is a fix in the code already, 
so 
you'll be happy to know that this works just fine with current SVN ;-)

Original comment by roberto.alsina on 15 Sep 2009 at 4:05

Attachments:

GoogleCodeExporter commented 9 years ago
Hehe, it looks like we got one problem in exchange for another :P

Revision: 1036
Error: AttributeError: Heading instance has no attribute 'text'

jart@compy:~/Documents$ pdb /usr/local/bin/rst2pdf ReST-cheatsheet.txt
> /usr/local/bin/rst2pdf(3)<module>()
-> __requires__ = 'rst2pdf==0.11.dev-r1036'
(Pdb) c

[...]

[DEBUG] createpdf.py:768 gen_elements: docutils.nodes.paragraph
[DEBUG] createpdf.py:769 [near line 127 in file UNKNOWN]
[DEBUG] createpdf.py:771 gen_elements: <paragraph>Title reference (book, etc.);
standard default role</paragraph>
[DEBUG] createpdf.py:469 self.gen_pdftext: docutils.nodes.paragraph
[DEBUG] createpdf.py:470 [near line 127 in file UNKNOWN]
[DEBUG] createpdf.py:472 self.gen_pdftext: <paragraph>Title reference (book, 
etc.);
standard default role</paragraph>
[DEBUG] createpdf.py:469 self.gen_pdftext: <class 'docutils.nodes.Text'>
[DEBUG] createpdf.py:470 [near line UNKNOWN in file UNKNOWN]
[DEBUG] createpdf.py:472 self.gen_pdftext: Title reference (book, etc.); 
standard
default role
[DEBUG] createpdf.py:749 self.gen_pdftext: Title reference (book, etc.); 
standard
default role
[DEBUG] createpdf.py:749 self.gen_pdftext: Title reference (book, etc.); 
standard
default role

[INFO] createpdf.py:1789 Starting build
Traceback (most recent call last):
  File "/usr/lib/python2.6/pdb.py", line 1283, in main
    pdb._runscript(mainpyfile)
  File "/usr/lib/python2.6/pdb.py", line 1202, in _runscript
    self.run(statement)
  File "/usr/lib/python2.6/bdb.py", line 368, in run
    exec cmd in globals, locals
  File "<string>", line 1, in <module>
  File "/usr/local/bin/rst2pdf", line 8, in <module>
    load_entry_point('rst2pdf==0.11.dev-r1036', 'console_scripts', 'rst2pdf')()
  File
"/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11.dev_r1036-py2.6.egg/rst2pdf
/createpdf.py",
line 2359, in main
    compressed=options.compressed)
  File
"/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11.dev_r1036-py2.6.egg/rst2pdf
/createpdf.py",
line 1790, in createPdf
    pdfdoc.multiBuild(elements)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line
855, in multiBuild
    self.build(tempStory, filename, canvasmaker)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line
777, in build
    self.handle_flowable(flowables)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line
681, in handle_flowable
    self.afterFlowable(S[0])
  File
"/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11.dev_r1036-py2.6.egg/rst2pdf
/createpdf.py",
line 1898, in afterFlowable
    level, text = flowable.level, flowable.text

AttributeError: Heading instance has no attribute 'text'

Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
>
/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11.dev_r1036-py2.6.egg/rst2pdf/
createpdf.py(1898)afterFlowable()
-> level, text = flowable.level, flowable.text

(Pdb) flowable
Heading(frags=[SW(Section), SP( ), SW(Structure)])

(Pdb) dir(flowable)
['HYPHENATE', 'OVERFLOW', 'SQUEEZE', '__doc__', '__init__', '__module__', 
'__repr__',
'_atTop', '_centerDrawParaLineX', '_doctemplateAttr', '_drawOn', '_fixedHeight',
'_fixedWidth', '_frameName', '_justifyDrawParaLineX', '_leftDrawParaLineX', 
'_lines',
'_rightDrawParaLineX', '_unused', 'beginText', 'bulletText', 'calcLineHeight',
'caseSensitive', 'draw', 'drawOn', 'findBestSolution', 'frags', 
'getKeepWithNext',
'getSpaceAfter', 'getSpaceBefore', 'height', 'i_wrap', 'identity', 'isIndexing',
'keepWhiteSpace', 'keepWithNext', 'label', 'level', 'minWidth', 'parent_id', 
'parse',
'rateHyph', 'snum', 'split', 'splitOn', 'stext', 'style', 'width', 'wrap', 
'wrapOn']

(Pdb) 

Original comment by jtunney@gmail.com on 15 Sep 2009 at 5:31

GoogleCodeExporter commented 9 years ago
Also it might be worth noting:

reportlab==2.3

Attached is my whole system-level pip freeze if it helps

Also dpkg --get-selections | grep python 

Original comment by jtunney@gmail.com on 15 Sep 2009 at 5:36

Attachments:

GoogleCodeExporter commented 9 years ago
Try removing wordaxe.

Original comment by roberto.alsina on 15 Sep 2009 at 5:45

GoogleCodeExporter commented 9 years ago
I apt-get removed python-wordaxe and that seems to solved what happened above 
but now
we have a new problem... similar to what happened before:

ValueError: Invalid color value u'white'

We can't win today ._.

[DEBUG] createpdf.py:759 gen_elements: docutils.nodes.paragraph
[DEBUG] createpdf.py:760 [near line 127 in file UNKNOWN]
[DEBUG] createpdf.py:762 gen_elements: <paragraph>Title reference (book, etc.);
standard default role</paragraph>
[DEBUG] createpdf.py:460 self.gen_pdftext: docutils.nodes.paragraph
[DEBUG] createpdf.py:461 [near line 127 in file UNKNOWN]
[DEBUG] createpdf.py:463 self.gen_pdftext: <paragraph>Title reference (book, 
etc.);
standard default role</paragraph>
[DEBUG] createpdf.py:460 self.gen_pdftext: <class 'docutils.nodes.Text'>
[DEBUG] createpdf.py:461 [near line UNKNOWN in file UNKNOWN]
[DEBUG] createpdf.py:463 self.gen_pdftext: Title reference (book, etc.); 
standard
default role
[DEBUG] createpdf.py:740 self.gen_pdftext: Title reference (book, etc.); 
standard
default role
[DEBUG] createpdf.py:740 self.gen_pdftext: Title reference (book, etc.); 
standard
default role

[INFO] createpdf.py:1780 Starting build
Traceback (most recent call last):
  File "/usr/local/bin/rst2pdf", line 8, in <module>
    load_entry_point('rst2pdf==0.11.dev-r1037', 'console_scripts', 'rst2pdf')()
  File
"/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11.dev_r1037-py2.6.egg/rst2pdf
/createpdf.py",
line 2350, in main
    compressed=options.compressed)
  File
"/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11.dev_r1037-py2.6.egg/rst2pdf
/createpdf.py",
line 1781, in createPdf
    pdfdoc.multiBuild(elements)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line
855, in multiBuild
    self.build(tempStory, filename, canvasmaker)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line
777, in build
    self.handle_flowable(flowables)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/doctemplate.py", line
665, in handle_flowable
    if frame.add(f, canv, trySplit=self.allowSplitting):
  File
"/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11.dev_r1037-py2.6.egg/rst2pdf
/flowables.py",
line 495, in add
    return Frame.add(self, flowable, canv, trySplit)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/frames.py", line 174, in _add
    flowable.drawOn(canv, self._x + self._leftExtraIndent, y, _sW=aW-w)
  File
"/usr/local/lib/python2.6/dist-packages/rst2pdf-0.11.dev_r1037-py2.6.egg/rst2pdf
/flowables.py",
line 209, in drawOn
    self.t.drawOn(canvas, x, y, _sW)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/flowables.py", line 105,
in drawOn
    self._drawOn(canvas)
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/flowables.py", line 89,
in _drawOn
    self.draw()#this is the bit you overload
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/tables.py", line 1278, in
draw
    self._drawBkgrnd()
  File "/usr/lib/python2.6/dist-packages/reportlab/platypus/tables.py", line 1323, in
_drawBkgrnd
    colorCycle = map(colors.toColorOrNone, arg)
  File "/usr/lib/python2.6/dist-packages/reportlab/lib/colors.py", line 563, in
toColorOrNone
    return toColor(arg, default)
  File "/usr/lib/python2.6/dist-packages/reportlab/lib/colors.py", line 555, in toColor
    raise ValueError('Invalid color value %r' % arg)
ValueError: Invalid color value u'white'

Original comment by jtunney@gmail.com on 15 Sep 2009 at 5:57

GoogleCodeExporter commented 9 years ago
That's a bug in reportlab :-(

The long version here is that I just can't reproduce this, because it only 
happens 
in Ubuntu.

I am comitting a workaround in r1038 but I am just guessing here :-(

Original comment by roberto.alsina on 15 Sep 2009 at 6:42

GoogleCodeExporter commented 9 years ago
Darn, it still doesn't seem to work :(

Do you know by any chance which particular version of ReportLab works 
correctly? 
This is sad because ReportLab is sooo hard to compile from source.

Also do you know what particular feature causes this bug?  Like is it the table
feature?  It would help to know what features to avoid.

Also I'm happy to provide an Ubuntu 9.04 shell with vim or emacs if you get 
tired of
throwing darts.  It's the least I can do :)

[...]
    load_entry_point('rst2pdf==0.11.dev-r1038', 'console_scripts', 'rst2pdf')()
[...]
  File "/usr/lib/python2.6/dist-packages/reportlab/pdfgen/textobject.py", line 98, in
setStrokeColor
    raise ValueError('Unknown color %r' % aColor)
ValueError: Unknown color u'black'

Original comment by jtunney@gmail.com on 15 Sep 2009 at 11:34

GoogleCodeExporter commented 9 years ago
It would be awesome. I don't want to download the ISO and create a VM just for 
this.

Mail me the details at ralsina@netmanagers.com.ar

Original comment by roberto.alsina on 16 Sep 2009 at 12:39

GoogleCodeExporter commented 9 years ago
Just another victim of the 'Unknown color' -issue:

rst2pdf: r1045
Reportlab: 2.3-1
Python: 2.6.2-5
OS: Arch

-----------------------------

[ERROR] pdfbuilder.py:105 Unknown color u'black'
Traceback (most recent call last):
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/pdfbuild
er.py",
line 102, in write
    docwriter.write(doctree, destination)
  File "/usr/lib/python2.6/site-packages/docutils/writers/__init__.py", line 76, in write
    self.translate()
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/pdfbuild
er.py",
line 558, in translate
    compressed=self.compressed)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1788, in createPdf
    pdfdoc.multiBuild(elements)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line
855, in multiBuild
    self.build(tempStory, filename, canvasmaker)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line
777, in build
    self.handle_flowable(flowables)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line
679, in handle_flowable
    if frame.add(S[0], canv, trySplit=0):
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/flowable
s.py", line
496, in add
    return Frame.add(self, flowable, canv, trySplit)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/frames.py", line 174, in _add
    flowable.drawOn(canv, self._x + self._leftExtraIndent, y, _sW=aW-w)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/flowables.py", line 105,
in drawOn
    self._drawOn(canvas)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/flowables.py", line 89,
in _drawOn
    self.draw()#this is the bit you overload
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/tables.py", line 1295, in
draw
    self._drawLines()
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/tables.py", line 1019, in
_drawLines
    getattr(self,_LineOpMap.get(op, '_drawUnknown' ))( (sc, sr), (ec, er), weight,
color, count, space)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/tables.py", line 1069, in
_drawHLinesB
    self._drawHLines((sc, sr+1), (ec, er+1), weight, color, count, space)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/tables.py", line 1055, in
_drawHLines
    self._prepLine(weight, color)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/tables.py", line 1045, in
_prepLine
    self.canv.setStrokeColor(color)
  File "/usr/lib/python2.6/site-packages/reportlab/pdfgen/textobject.py", line 98, in
setStrokeColor
    raise ValueError('Unknown color %r' % aColor)
ValueError: Unknown color u'black'

Original comment by juha.p.mustonen on 17 Sep 2009 at 12:07

GoogleCodeExporter commented 9 years ago
@comment 9

Gack, and that's exactly like my own development box, too :-(

I wonder why I don't see this... what'syour locale? Mine is 

$ echo $LANG
en_US.utf8

Original comment by roberto.alsina on 17 Sep 2009 at 12:32

GoogleCodeExporter commented 9 years ago
Added another guess in r1048. Could one of you test it?

Original comment by roberto.alsina on 17 Sep 2009 at 12:39

GoogleCodeExporter commented 9 years ago
Yes r1048 seems to be working now!  Thank you so much :)

For the record:

jart@compy:~/Documents/Cheatsheets$ echo $LANG
en_US.UTF-8

Unrelated: Unit tests still don't pass, not sure if I'm running them right:

jart@compy:~/Desktop/rst2pdf$ python setup.py test
ERROR: test_transition (rst2pdf.tests.test_rst2pdf.GenerationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jart/Desktop/rst2pdf/rst2pdf/tests/test_rst2pdf.py", line 50, in
test_transition
    elements=self.converter.gen_elements(doctree,0)
  File "/home/jart/Desktop/rst2pdf/rst2pdf/createpdf.py", line 789, in gen_elements
    node.elements = self.gather_elements(node, style=style)
  File "/home/jart/Desktop/rst2pdf/rst2pdf/createpdf.py", line 1614, in gather_elements
    if 'float' in style.__dict__:
AttributeError: 'int' object has no attribute '__dict__'

Original comment by jtunney@gmail.com on 17 Sep 2009 at 8:48

GoogleCodeExporter commented 9 years ago
I committed another (better) fix in r1049, could you try it again?

Original comment by roberto.alsina on 17 Sep 2009 at 9:11

GoogleCodeExporter commented 9 years ago
Tried with r1049:

[ERROR] pdfbuilder.py:105 'unicode' object has no attribute 'hexval'
Traceback (most recent call last):
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/pdfbuild
er.py",
line 102, in write
    docwriter.write(doctree, destination)
  File "/usr/lib/python2.6/site-packages/docutils/writers/__init__.py", line 76, in write
    self.translate()
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/pdfbuild
er.py",
line 558, in translate
    compressed=self.compressed)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1754, in createPdf
    elements = self.gen_elements(doctree)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
789, in gen_elements
    node.elements = self.gather_elements(node, style=style)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1618, in gather_elements
    r.extend(self.gen_elements(n, style=style))
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1149, in gen_elements
    node.elements = self.gather_elements(node)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1618, in gather_elements
    r.extend(self.gen_elements(n, style=style))
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
793, in gen_elements
    node.elements = self.gather_elements(node, style=style)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1618, in gather_elements
    r.extend(self.gen_elements(n, style=style))
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1149, in gen_elements
    node.elements = self.gather_elements(node)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1618, in gather_elements
    r.extend(self.gen_elements(n, style=style))
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
793, in gen_elements
    node.elements = self.gather_elements(node, style=style)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1618, in gather_elements
    r.extend(self.gen_elements(n, style=style))
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1149, in gen_elements
    node.elements = self.gather_elements(node)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1618, in gather_elements
    r.extend(self.gen_elements(n, style=style))
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1149, in gen_elements
    node.elements = self.gather_elements(node)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1618, in gather_elements
    r.extend(self.gen_elements(n, style=style))
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1177, in gen_elements
    style = self.styles["enumerated_list_item"])
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1618, in gather_elements
    r.extend(self.gen_elements(n, style=style))
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1225, in gen_elements
    el = self.gather_elements(node, style=style)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1618, in gather_elements
    r.extend(self.gen_elements(n, style=style))
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1323, in gen_elements
    self.gather_pdftext(node, replaceEnt = True),
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
454, in gather_pdftext
    for n in node.children])
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
722, in gen_pdftext
    node.pdftext = self.gather_pdftext(node)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
454, in gather_pdftext
    for n in node.children])
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
714, in gen_pdftext
    ftag = self.styleToFont(node['classes'][0])
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
443, in styleToFont
    s.textColor.hexval()[2:], bc.hexval()[2:])
AttributeError: 'unicode' object has no attribute 'hexval'

oh, and my $LANG:
en_US.utf8

And for the sake of curiosity, tested also with r1048:

[ERROR] pdfbuilder.py:105 Flowable <DelayedTable at 0x9d7ce2c>... too large on 
page 9
Traceback (most recent call last):
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/pdfbuild
er.py",
line 102, in write
    docwriter.write(doctree, destination)
  File "/usr/lib/python2.6/site-packages/docutils/writers/__init__.py", line 76, in write
    self.translate()
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/pdfbuild
er.py",
line 558, in translate
    compressed=self.compressed)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1788, in createPdf
    pdfdoc.multiBuild(elements)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line
855, in multiBuild
    self.build(tempStory, filename, canvasmaker)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line
777, in build
    self.handle_flowable(flowables)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line
694, in handle_flowable
    raise LayoutError(ident)
LayoutError: Flowable <DelayedTable at 0x9d7ce2c>... too large on page 9

Original comment by juha.p.mustonen on 18 Sep 2009 at 5:48

GoogleCodeExporter commented 9 years ago
There was a silly typo in the previous commit. Please try again in r1050.

The problem with "Flowable <delayedtable...> too large": try using 
pdf_splittables = 
True in conf.py , please?

Original comment by roberto.alsina on 19 Sep 2009 at 5:37

GoogleCodeExporter commented 9 years ago
Sure thing. Outcome after setting the config value:

[ERROR] pdfbuilder.py:105 _atTop
Traceback (most recent call last):
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/pdfbuild
er.py",
line 102, in write
    docwriter.write(doctree, destination)
  File "/usr/lib/python2.6/site-packages/docutils/writers/__init__.py", line 76, in write
    self.translate()
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/pdfbuild
er.py",
line 558, in translate
    compressed=self.compressed)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1788, in createPdf
    pdfdoc.multiBuild(elements)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line
855, in multiBuild
    self.build(tempStory, filename, canvasmaker)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line
777, in build
    self.handle_flowable(flowables)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line
673, in handle_flowable
    S = frame.split(f,canv)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/frames.py", line 201, in
split
    r = flowable.split(self._aW, y-p-s)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/flowable
s.py", line
262, in split
    text[l].wrap(w-dw,h-lh-dh)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/flowable
s.py", line
74, in wrap
    if not self._atTop:
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/flowables.py", line 382,
in __getattr__
    raise AttributeError(a)
AttributeError: _atTop

rst2pdf: r1050

Original comment by juha.p.mustonen on 21 Sep 2009 at 7:24

GoogleCodeExporter commented 9 years ago
Juha, what are you building? Can I have a look? :-)

Original comment by roberto.alsina on 21 Sep 2009 at 11:53

GoogleCodeExporter commented 9 years ago
Unfortunately, I can't: proprietary documents :) But they shouldn't be anything
special though: normal project documentation you can think of.

But what I can do is to test the rst2pdf against them. If rst2pdf could provide 
some
information about the context/text what it was processing when the error 
occurred, I
can possibly to provide some example documents how to reproduce the issue.

Related to the subject, I run r1050 also against the another document, with the 
results:

[ERROR] pdfbuilder.py:105 Splitting error(n==2) on page 23 in
<SplitTable at 0xafde10c> containing: [Paragraph(
'style': <ParagraphStyle 'enumerated_list_item'>
'bulletText': None
'text': 'Replace the invoker type to be pooled (in all the places that matches
with the string</b
Traceback (most recent call last):
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/pdfbuild
er.py",
line 102, in write
    docwriter.write(doctree, destination)
  File "/usr/lib/python2.6/site-packages/docutils/writers/__init__.py", line 76, in write
    self.translate()
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/pdfbuild
er.py",
line 558, in translate
    compressed=self.compressed)
  File
"/usr/lib/python2.6/site-packages/rst2pdf-0.11.dev_r0-py2.6.egg/rst2pdf/createpd
f.py", line
1788, in createPdf
    pdfdoc.multiBuild(elements)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line
855, in multiBuild
    self.build(tempStory, filename, canvasmaker)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line
777, in build
    self.handle_flowable(flowables)
  File "/usr/lib/python2.6/site-packages/reportlab/platypus/doctemplate.py", line
686, in handle_flowable
    raise LayoutError(ident)
LayoutError: Splitting error(n==2) on page 23 in
<SplitTable at 0xafde10c> containing: [Paragraph(
'style': <ParagraphStyle 'enumerated_list_item'>
'bulletText': None
'text': 'Replace the invoker type to be pooled (in all the places that matches
with the string</b

pdf_stylesheets = ['sphinx', 'kerning']
pdf_splittables = True

Hope it helps.

Original comment by juha.p.mustonen on 21 Sep 2009 at 12:56

GoogleCodeExporter commented 9 years ago
This bug should be fixed already.

In any case, I can't reproduce it without a test case.

Original comment by roberto.alsina on 19 Mar 2010 at 4:34

GoogleCodeExporter commented 9 years ago

Original comment by roberto.alsina on 19 Mar 2010 at 4:34