#10107 closed defect (fixed)
HTML preview using ReStructuredTextRenderer fails
| Reported by: | Owned by: | Remy Blank | |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.12.3 |
| Component: | general | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Thijs Triemstra | Branch: | |
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
So, I'm getting the following error in my logs whenever I try and view a page with ReST on it. The page it self does return the raw plain text at least.
I'm not sure if this is a Trac issue or a docutils issue.
2011-03-30 11:39:39,792 Trac[api] WARNING: HTML preview using ReStructuredTextRenderer failed:
Traceback (most recent call last):
File "build/bdist.linux-x86_64/egg/trac/mimeview/api.py", line 767, in render
File "build/bdist.linux-x86_64/egg/trac/mimeview/rst.py", line 248, in render
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/core.py", line 427, in publish_parts
enable_exit_status=enable_exit_status)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/core.py", line 641, in publish_programmatically
output = pub.publish(enable_exit_status=enable_exit_status)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/core.py", line 203, in publish
self.settings)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/readers/__init__.py", line 69, in read
self.parse()
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/readers/__init__.py", line 75, in parse
self.parser.parse(self.input, document)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/__init__.py", line 157, in parse
self.statemachine.run(inputlines, document, inliner=self.inliner)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 170, in run
input_source=document['source'])
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 232, in run
context, next_state, result = self.check_line(
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 454, in check_line
return method(match, context, next_state)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 2940, in text
self.section(title.lstrip(), source, style, lineno + 1, messages)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 329, in section
self.new_subsection(title, lineno, messages)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 398, in new_subsection
node=section_node, match_titles=1)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 284, in nested_parse
node=node, match_titles=match_titles)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 195, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 232, in run
context, next_state, result = self.check_line(
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 454, in check_line
return method(match, context, next_state)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 2706, in underline
self.section(title, source, style, lineno - 1, messages)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 329, in section
self.new_subsection(title, lineno, messages)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 398, in new_subsection
node=section_node, match_titles=1)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 284, in nested_parse
node=node, match_titles=match_titles)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 195, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 232, in run
context, next_state, result = self.check_line(
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 454, in check_line
return method(match, context, next_state)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 2706, in underline
self.section(title, source, style, lineno - 1, messages)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 329, in section
self.new_subsection(title, lineno, messages)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 398, in new_subsection
node=section_node, match_titles=1)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 284, in nested_parse
node=node, match_titles=match_titles)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 195, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 232, in run
context, next_state, result = self.check_line(
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 454, in check_line
return method(match, context, next_state)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 2706, in underline
self.section(title, source, style, lineno - 1, messages)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 329, in section
self.new_subsection(title, lineno, messages)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 398, in new_subsection
node=section_node, match_titles=1)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 284, in nested_parse
node=node, match_titles=match_titles)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 195, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 232, in run
context, next_state, result = self.check_line(
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 454, in check_line
return method(match, context, next_state)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 2706, in underline
self.section(title, source, style, lineno - 1, messages)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 329, in section
self.new_subsection(title, lineno, messages)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 398, in new_subsection
node=section_node, match_titles=1)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 284, in nested_parse
node=node, match_titles=match_titles)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 195, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 232, in run
context, next_state, result = self.check_line(
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 454, in check_line
return method(match, context, next_state)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 2706, in underline
self.section(title, source, style, lineno - 1, messages)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 329, in section
self.new_subsection(title, lineno, messages)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 398, in new_subsection
node=section_node, match_titles=1)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 284, in nested_parse
node=node, match_titles=match_titles)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 195, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 232, in run
context, next_state, result = self.check_line(
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/statemachine.py", line 454, in check_line
return method(match, context, next_state)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/parsers/rst/states.py", line 2693, in underline
source=src, line=srcline)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/utils.py", line 230, in warning
return self.system_message(self.WARNING_LEVEL, *args, **kwargs)
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/utils.py", line 198, in system_message
self.stream.write(msgtext)
IOError: [Errno 9] Bad file descriptor
Attachments (0)
Change History (12)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
| Milestone: | → 0.12.3 |
|---|
Thanks for the report! Would be even better if you could provide us with a snippet of rst which can be used to reproduce the problem.
comment:3 by , 15 years ago
| Milestone: | 0.12.3 |
|---|
Ya, It's a huge page (around 1000+ lines or so). I'll see if I can narrow down the text to see what is causing it, if I can't I'll post the whole in a pastebin or something.
comment:4 by , 15 years ago
| Milestone: | → 0.12.3 |
|---|
comment:5 by , 15 years ago
So the following code will break any ReST page on our trac install:
Scheduling Pickups (not currently needed for any carrier) =========================================
comment:6 by , 15 years ago
So it seems like the real issue here is that because the font in text-area makes it look like there are enough = signs, but in reality, there are less than enough for it to be valid ReST. So instead of showing some sort of syntax error, it just refuses to render. It'd be nice if there was better error reporting (Maybe just not rendering that one block?), but I guess this is technically user error.
comment:8 by , 15 years ago
Well that's interesting, either of those errors would be nice. In my install I get this: http://cl.ly/5jaB
follow-up: 11 comment:9 by , 15 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
My guess is that in your environment, stderr is closed.
File "/mnt/ebs/python2.4/site-packages/docutils-0.7-py2.4.egg/docutils/utils.py", line 198, in system_message
self.stream.write(msgtext)
And therefore the above fails.
For us, when rendering the examples set up by Thijs, the following lines end up in the web front-end error log:
<string>:2: (WARNING/2) Title underline too short. Scheduling Pickups (not currently needed for any carrier) =========================================
So we probably need to replace this self.stream.write with a no-op.
comment:10 by , 15 years ago
The question mark and 'double reference' to the header on the 0.13 test page look odd though (might open a ticket for it), I think I prefer the 0.12 error message (in some cases). Or is that configurable somewhere?
comment:11 by , 14 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:12 by , 14 years ago
| Owner: | changed from to |
|---|



Oh ya, I'm on CentOS 5, with python 2.4. I installed trac and docutils via easy_install and am on trac 0.12.2 and docutils 0.7.