Edgewall Software
Modify

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#12370 closed defect (fixed)

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

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.0.12
Component: wiki system Version:
Severity: normal Keywords: imagemacro
Cc: Branch:
Release Notes:

Trap ValueError and render a system-message for non-integer macro arguments that should be integers.

API Changes:
Internal Changes:

Description

From the logs:

[pid 10253 140015545095936] 2016-02-13 07:15:58,674 Trac[formatter] ERROR: Macro Image(icon_PyCharm.png, link=https://www.jetbrains.com/pycharm/, 35px, margin-right=10px, align=left) failed:
Traceback (most recent call last):
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/wiki/formatter.py", line 798, in _macro_formatter
    return macro.ensure_inline(macro.process(args))
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/wiki/formatter.py", line 375, in process
    text = self.processor(text)
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/wiki/formatter.py", line 347, in _macro_processor
    text)
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/wiki/macros.py", line 596, in expand_macro
    style[key] = ' %dpx' % int(val)
ValueError: invalid literal for int() with base 10: '10px'

Attachments (0)

Change History (7)

comment:1 by Ryan J Ollos, 5 years ago

We could also fix this macro argument issue:

[pid 3212 139730844530432] 2016-03-15 02:07:56,896 Trac[formatter] ERROR: Macro PageOutline(2-*) failed:
Traceback (most recent call last):
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/wiki/formatter.py", line 802, in _macro_formatter
    return macro.ensure_inline(macro.process(args))
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/wiki/formatter.py", line 379, in process
    text = self.processor(text)
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/wiki/formatter.py", line 351, in _macro_processor
    text)
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/wiki/macros.py", line 421, in expand_macro
    for d in depth.split('-', 1)]
ValueError: invalid literal for int() with base 10: '*'
[pid 3212 139730844530432] 2016-03-15 02:08:30,180 Trac[formatter] ERROR: Macro PageOutline(2+3) failed:
Traceback (most recent call last):
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/wiki/formatter.py", line 802, in _macro_formatter
    return macro.ensure_inline(macro.process(args))
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/wiki/formatter.py", line 379, in process
    text = self.processor(text)
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/wiki/formatter.py", line 351, in _macro_processor
    text)
  File "/usr/local/virtualenv/1.1dev/lib/python2.7/site-packages/trac/wiki/macros.py", line 423, in expand_macro
    min_depth = max_depth = int(depth)
ValueError: invalid literal for int() with base 10: '2+3'

comment:2 by Ryan J Ollos, 5 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:3 by Ryan J Ollos, 4 years ago

Milestone: 1.0.111.0.12

comment:4 by Ryan J Ollos, 4 years ago

comment:5 by Ryan J Ollos, 4 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to 1.0-stable in [14769], merged to trunk in [14770].

comment:6 by anonymous, 4 years ago

Release Notes: modified (diff)

comment:7 by Ryan J Ollos, 4 years ago

Regression in [14769] reported in #12517.

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'.
to The owner will be changed from Ryan J Ollos 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.