Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12573 closed defect (fixed)

ValueError: invalid literal for int() with base 10: 'rev'

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Component: IncludeMacro
Severity: normal Keywords:
Cc: Trac Release:

Description

Errors should be trapped so that we don't get tracebacks such as the following in the logs:

2015-11-11 15:32:00,042 Trac[formatter] ERROR: Macro Include(IncludeMacro@rev) failed:
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/wiki/formatter.py", line 789, in _macro_formatter
    return macro.ensure_inline(macro.process(args))
  File "build/bdist.linux-i686/egg/trac/wiki/formatter.py", line 358, in process
    text = self.processor(text)
  File "build/bdist.linux-i686/egg/trac/wiki/formatter.py", line 345, in _macro_processor
    text)
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracIncludeMacro-3.0.0dev-py2.6.egg/includemacro/macros.py", line 103, in expand_macro
    page = WikiPage(self.env, page_name, page_version)
  File "build/bdist.linux-i686/egg/trac/wiki/model.py", line 45, in __init__
    version = int(version)  # must be a number or None
ValueError: invalid literal for int() with base 10: 'rev'
2015-11-11 15:32:22,020 Trac[formatter] ERROR: Macro Include(IncludeMacro@rev14) failed:
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/wiki/formatter.py", line 789, in _macro_formatter
    return macro.ensure_inline(macro.process(args))
  File "build/bdist.linux-i686/egg/trac/wiki/formatter.py", line 358, in process
    text = self.processor(text)
  File "build/bdist.linux-i686/egg/trac/wiki/formatter.py", line 345, in _macro_processor
    text)
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracIncludeMacro-3.0.0dev-py2.6.egg/includemacro/macros.py", line 103, in expand_macro
    page = WikiPage(self.env, page_name, page_version)
  File "build/bdist.linux-i686/egg/trac/wiki/model.py", line 45, in __init__
    version = int(version)  # must be a number or None
ValueError: invalid literal for int() with base 10: 'rev14'
2015-11-11 15:33:39,632 Trac[formatter] ERROR: Macro Include(IncludeMacro@rev#14) failed:
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/wiki/formatter.py", line 789, in _macro_formatter
    return macro.ensure_inline(macro.process(args))
  File "build/bdist.linux-i686/egg/trac/wiki/formatter.py", line 358, in process
    text = self.processor(text)
  File "build/bdist.linux-i686/egg/trac/wiki/formatter.py", line 345, in _macro_processor
    text)
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracIncludeMacro-3.0.0dev-py2.6.egg/includemacro/macros.py", line 103, in expand_macro
    page = WikiPage(self.env, page_name, page_version)
  File "build/bdist.linux-i686/egg/trac/wiki/model.py", line 45, in __init__
    version = int(version)  # must be a number or None
ValueError: invalid literal for int() with base 10: 'rev#14'
2015-11-11 15:33:46,802 Trac[formatter] ERROR: Macro Include(IncludeMacro@rev14) failed:
Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/wiki/formatter.py", line 789, in _macro_formatter
    return macro.ensure_inline(macro.process(args))
  File "build/bdist.linux-i686/egg/trac/wiki/formatter.py", line 358, in process
    text = self.processor(text)
  File "build/bdist.linux-i686/egg/trac/wiki/formatter.py", line 345, in _macro_processor
    text)
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracIncludeMacro-3.0.0dev-py2.6.egg/includemacro/macros.py", line 103, in expand_macro
    page = WikiPage(self.env, page_name, page_version)
  File "build/bdist.linux-i686/egg/trac/wiki/model.py", line 45, in __init__
    version = int(version)  # must be a number or None
ValueError: invalid literal for int() with base 10: 'rev14'

Attachments (0)

Change History (5)

comment:1 Changed 8 years ago by Ryan J Ollos

Status: newaccepted

comment:2 Changed 8 years ago by Ryan J Ollos

In 15118:

3.0.0dev: Trap exception from invalid wiki page version

Refs #12573.

comment:3 Changed 8 years ago by Ryan J Ollos

Created trac:#12273 to make WikiPage class more robust to an invalid version argument. Created trac:#12274 to trap negative revision numbers with the Subversion backend.

comment:4 Changed 8 years ago by Ryan J Ollos

Resolution: fixed
Status: acceptedclosed

In 15119:

3.0.0dev: Trap NoSuchChangeset exceptions

Fixes #12573.

comment:5 Changed 8 years ago by Ryan J Ollos

In 15121:

3.0.0dev: Revise comment

Refs #12573.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.