Edgewall Software
Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#8977 closed defect (fixed)

IndexError: string index out of range

Reported by: Remy Blank Owned by: Christian Boos
Priority: high Milestone: 0.12
Component: wiki system Version: 0.12dev
Severity: normal Keywords: table colspan
Cc: Branch:
Release Notes:
API Changes:

Description

How to Reproduce

While doing a POST operation on /wiki/WikiStart, Trac issued an internal error.

This can be reproduced on t.e.o by inserting the following table into a wiki page, and previewing the page:

||column1||||

Admittedly, this syntax is now ill-defined (with the colspan functionality from #1293), but it was legal before. At any rate, this shouldn't trigger an internal error, as it prevents rendering of the whole page.

Request parameters:

{'__FORM_TOKEN': u'2ab0ddb50d29e8ee64e76d63',
 'action': u'edit',
 'comment': u'',
 'from_editor': u'1',
 'page': u'WikiStart',
 'preview': u'Preview Page',
 'readonly': u'on',
 'scroll_bar_pos': u'0',
 'sidebyside': u'on',
 'text': u'{{{\r\n#!div style="float: right; font-size: 90%; margin: 0 2em; text-align: center"\r\n\r\n\'\'\' try out our demos! \'\'\'\r\n[[br]]\r\n[/demo-0.11 Trac 0.11 demo] \r\n[[br]]or[[br]]\r\n[/demo-0.12 Trac 0.12 demo]\r\n\r\n}}}\r\n= Welcome to the Trac Open Source Project. =\r\n\r\n||column1||||\r\n\r\nTrac is an enhanced wiki and issue tracking system for software development projects.\r\nTrac uses a minimalistic approach to web-based software project management.\r\nOur mission is to help developers write great software while staying out of\r\nthe way. Trac should impose as little as possible on a team\'s established\r\ndevelopment process and policies.\r\n\r\n\r\nIt provides an interface to [http://subversion.tigris.org/ Subversion] (or other [PluginList#VersionControlSystems version control systems]), an integrated Wiki and convenient reporting facilities. \r\n\r\nTrac allows [wiki:WikiFormatting wiki markup] in issue descriptions and commit messages, creating \r\nlinks and seamless references between bugs, tasks, changesets, files and wiki pages.  \r\nA [wiki:TracTimeline timeline] shows all current and past project events in order, \r\nmaking the acquisition of an overview of the project and tracking progress very easy.\r\nThe [wiki:TracRoadmap roadmap] shows the road ahead, listing the upcoming milestones.\r\n\r\n== Good Starting Points ==\r\n\r\n * Get started with the software:\r\n  [[span(TracGuide,title=Starting point for Trac documentation)]], \r\n  [[span(TracDownload,title=Trac is open source software\\, available for download)]],\r\n  [[span(TracFaq,title=Frequently asked questions)]], \r\n  [[span(PluginList,title=Plugins for extending Trac)]],\r\n  [[span(CookBook,title=Recipes for installing and maintaining Trac)]]\r\n * Watch it evolve:\r\n  [[span(ChangeLog,title=Recent changes between Trac releases)]],\r\n  [[span(RoadMap,title=The proverbial road ahead)]],\r\n  [[span(SeaChange,title=The long term ambitions)]]\r\n * Communicate:\r\n  \'\'\'[[span(MailingList,title=Join the mailing lists for user and developer discussions)]]\'\'\',\r\n  [[span(IrcChannel,title=Chat and discuss Trac or get support)]]\r\n * Get involved:\r\n  [[span(TracProject,title=Learn more about the project)]],\r\n  \'\'\'[[span(HowToContribute,title=Practical tips for providing useful contributions)]]\'\'\',\r\n  [[span(TracTeam,title=It\'s their fault - well not really)]],\r\n  [[span(AboutTrac,title=Links to presentation materials\\, references\\, etc.)]],\r\n  [[span(TracDev,title=Dive into the internals of Trac)]]\r\n\r\nFor a complete list of available wiki pages, see the TitleIndex.\r\n\r\n== About This Site ==\r\nThis is the TracWiki, editable by its users. This [http://c2.com/cgi/wiki?WikiWikiWeb is a feature]. \r\n\r\nHowever the site you are currently visiting tracks the actual development of the Trac project, so \'\'\'please don\'t make edits here on trac.edgewall.org simply for the sake of testing Trac\'\'\'. [[br]]\r\n\r\nInstead, if you want to test out some of the features in Trac, please use the \'\'\'[/demo-0.11 demo-0.11 site]\'\'\' or \'\'\'[/demo-0.11 demo-0.12 site]\'\'\'.\r\n\r\n== Trac Users ==\r\nAre you curious who is using Trac, or would like to list your own name, visit the TracUsers page.\r\n',
 'version': u'123'}

User Agent was: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7

System Information

Trac 0.12dev-r9030
Python 2.5.2 (r252:60911, Oct 5 2008, 19:29:17)
[GCC 4.3.2]
setuptools 0.6c9
psycopg2 2.0.8
Genshi 0.6dev-r1092
Babel 0.9.4
Pygments 1.1.1dev-20091217
Subversion 1.5.1 (r32289)
Docutils 0.6
jQuery 1.3.2

Enabled Plugins

Python Traceback

Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 495, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-x86_64/egg/trac/web/main.py", line 249, in dispatch
    content_type)
  File "build/bdist.linux-x86_64/egg/trac/web/chrome.py", line 854, in render_template
    stream.render(method, doctype=doctype, out=buffer)
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 183, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 58, in encode
    for chunk in iterator:
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 339, in __call__
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 826, in __call__
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 670, in __call__
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 771, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "build/bdist.linux-x86_64/egg/genshi/output.py", line 586, in __call__
    for ev in stream:
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "build/bdist.linux-x86_64/egg/trac/web/chrome.py", line 939, in _strip_accesskeys
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "build/bdist.linux-x86_64/egg/trac/web/chrome.py", line 928, in _generate
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 592, in _include
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 380, in _match
    ctxt, start=idx + 1, **vars):
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 380, in _match
    ctxt, start=idx + 1, **vars):
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 380, in _match
    ctxt, start=idx + 1, **vars):
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 330, in _match
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 532, in _flatten
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/path.py", line 588, in _generate
    subevent = next()
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 592, in _include
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 330, in _match
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 319, in _strip
    event = next()
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 532, in _flatten
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/path.py", line 588, in _generate
    subevent = next()
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 592, in _include
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 319, in _strip
    event = next()
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 532, in _flatten
    for kind, data, pos in stream:
  File "build/bdist.linux-x86_64/egg/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/path.py", line 588, in _generate
    subevent = next()
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 592, in _include
    for event in stream:
  File "build/bdist.linux-x86_64/egg/genshi/template/markup.py", line 319, in _strip
    event = next()
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 552, in _flatten
    result = _eval_expr(data, ctxt, vars)
  File "build/bdist.linux-x86_64/egg/genshi/template/base.py", line 277, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "build/bdist.linux-x86_64/egg/genshi/template/eval.py", line 178, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/tmp/.lighttpd-egg-cache-0.12-pre-multirepos/Trac-0.12dev_r9030-py2.5.egg-tmp/trac/wiki/templates/wiki_edit.html", line 136, in <Expression u'wiki_to_html(context(page.resource), page.text)'>
    ${wiki_to_html(context(page.resource), page.text)}
  File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 1216, in format_to_html
    return HtmlFormatter(env, context, wikidom).generate(escape_newlines)
  File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 1171, in generate
    escape_newlines)
  File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 960, in format
    result = re.sub(self.wikiparser.rules, self.replace, line)
  File "/usr/lib/python2.5/re.py", line 150, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 904, in replace
    replacement = self.handle_match(fullmatch)
  File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 900, in handle_match
    return internal_handler(match, fullmatch)
  File "build/bdist.linux-x86_64/egg/trac/wiki/formatter.py", line 784, in _table_cell_formatter
    alignleft = self.line[end] != ' '
IndexError: string index out of range

Attachments (0)

Change History (2)

comment:1 by Christian Boos, 10 years ago

Component: generalwiki system
Keywords: table colspan added
Resolution: fixed
Status: newclosed

A bit more tricky than I thought, but should be fixed in r9050.

in reply to:  1 comment:2 by Remy Blank, 10 years ago

Replying to cboos:

A bit more tricky than I thought,

That's what I thought as well :)

but should be fixed in r9050.

Thanks!

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 as closed 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.