Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#4349 closed defect (worksforme)

PygmentsRenderer produces spurious END token

Reported by: Tim Hatch <trac@…> Owned by: Christian Boos
Priority: normal Milestone:
Component: version control/browser Version: devel
Severity: normal Keywords: mimeview
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Feed it an empty file and you'll get the following while trying to render:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/mimeview/api.py", line 475, in render
    return self._annotate(result, annotations, m and Ranges(m))
  File "/usr/lib/python2.4/site-packages/trac/mimeview/api.py", line 512, in _annotate
    tag.tbody(_body_rows())
  File "build/bdist.linux-i686/egg/genshi/builder.py", line 177, in __call__
  File "build/bdist.linux-i686/egg/genshi/builder.py", line 32, in __call__
  File "build/bdist.linux-i686/egg/genshi/builder.py", line 57, in append
  File "/usr/lib/python2.4/site-packages/trac/mimeview/api.py", line 501, in _body_rows
    for idx, line in enumerate(_group_lines(stream)):
  File "/usr/lib/python2.4/site-packages/trac/mimeview/api.py", line 676, in _group_lines
    for kind, data, pos in _generate():
  File "/usr/lib/python2.4/site-packages/trac/mimeview/api.py", line 671, in _generate
    stack.pop()
IndexError: pop from empty list

This is the entirety of the events which causes this traceback, generated by the PygmentsRenderer:

'END', QName(u'span'), (None, -1, -1)

I believe this is caused by yielding an END token regardless of whether a span was open (lattrs is None). Attempting to correct for this is proving quite confusing because it won't produce the number of \n that seems logical. I think this needs another pair of eyes.

Attachments (0)

Change History (1)

comment:1 by Tim Hatch <trac@…>, 18 years ago

Resolution: worksforme
Status: newclosed

With the addition of a test suite and reverting local modification to trunk, I am not able to reproduce this issue any longer. If there is independent verification, reopen… otherwise closing as worksforme.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos 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.