Edgewall Software
Modify

Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#10107 closed defect (fixed)

HTML preview using ReStructuredTextRenderer fails

Reported by: nat@… 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 anonymous, 14 years ago

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.

comment:2 by Christian Boos, 14 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 nat@…, 14 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 Nat Welch <nat@…>, 14 years ago

Milestone: 0.12.3

comment:5 by Nat Welch <nat@…>, 14 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 Nat Welch <nat@…>, 14 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:7 by Thijs Triemstra, 14 years ago

Cc: Thijs Triemstra added

The difference between 0.12 and 0.13:

comment:8 by Nat Welch <nat@…>, 14 years ago

Well that's interesting, either of those errors would be nice. In my install I get this: http://cl.ly/5jaB

comment:9 by Christian Boos, 14 years ago

Owner: set to Christian Boos
Status: newassigned

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 Thijs Triemstra, 14 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?

in reply to:  9 comment:11 by Remy Blank, 13 years ago

Resolution: fixed
Status: assignedclosed

Replying to cboos:

My guess is that in your environment, stderr is closed.

Good guess. Fortunately, this can be disabled, as in [10827].

comment:12 by Remy Blank, 13 years ago

Owner: changed from Christian Boos to Remy Blank

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.