Edgewall Software
Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#11308 closed defect (fixed)

ValueError while rendering `log:@1-2-3`

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: version control/log view Version: 0.12-stable
Severity: normal Keywords: wiki
Cc:
Release Notes:

Fix ValueError while wiki-rendering log: link with invalid ranges, e.g. log:@1-2-3.

API Changes:

Description

When rendering log:@1-2-3 if each revision on the default repository is existent, I got the following error.

...
  File "/home/jun66j5/src/trac/edgewall/git/trac/ticket/templates/ticket_box.html", line 77, in <Expression u'wiki_to_html(context, ticket.description, escape_newlines=preserve_newlines)'>
    ${wiki_to_html(context, ticket.description, escape_newlines=preserve_newlines)}
  File "/home/jun66j5/src/trac/edgewall/git/trac/util/compat.py", line 83, in newfunc
    return func_(*(args + fargs), **dict(kwargs, **fkwargs))
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 1501, in format_to_html
    return HtmlFormatter(env, context, wikidom).generate(escape_newlines)
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 1456, in generate
    escape_newlines)
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 1243, in format
    result = re.sub(self.wikiparser.rules, self.replace, line)
  File "/home/jun66j5/venv/py24/lib/python2.4/sre.py", line 142, in sub
    return _compile(pattern, 0).sub(repl, string, count)
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 1161, in replace
    replacement = self.handle_match(fullmatch)
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 1157, in handle_match
    return internal_handler(match, fullmatch)
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 533, in _shref_formatter
    return self._make_link(ns, target, match, match, fullmatch)
  File "/home/jun66j5/src/trac/edgewall/git/trac/wiki/formatter.py", line 590, in _make_link
    fullmatch)
  File "/home/jun66j5/src/trac/edgewall/git/trac/versioncontrol/web_ui/log.py", line 373, in _format_link
    revranges = self._normalize_ranges(repos, path, revs)
  File "/home/jun66j5/src/trac/edgewall/git/trac/versioncontrol/web_ui/log.py", line 416, in _normalize_ranges
    return Ranges(ranges)
  File "/home/jun66j5/src/trac/edgewall/git/trac/util/__init__.py", line 724, in __init__
    self.appendrange(r)
  File "/home/jun66j5/src/trac/edgewall/git/trac/util/__init__.py", line 742, in appendrange
    a, b = int(x), int(x)
ValueError: invalid literal for int(): 1-2-3

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by Jun Omae

Owner: set to Jun Omae
Status: newassigned

My proposal fix is jomae.git:ticket11308.

comment:2 Changed 5 years ago by Jun Omae

Keywords: wiki added
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed
Last edited 5 years ago by Ryan J Ollos (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted.
to The owner will be changed from Jun Omae 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.