Edgewall Software
Modify

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#13134 closed defect (fixed)

UndefinedError: 'int' is undefined

Reported by: anonymous Owned by: Jun Omae
Priority: normal Milestone: 1.3.4
Component: report system Version: 1.3dev
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Fixed 'int' is undefined error in report_view.html.

Description

I created a simple report: SELECT * FROM wiki:

Traceback (most recent call last):
  File "build\bdist.win32\egg\trac\web\main.py", line 664, in _dispatch_request
    dispatcher.dispatch(req)
  File "build\bdist.win32\egg\trac\web\main.py", line 270, in dispatch
    method=method)
  File "build\bdist.win32\egg\trac\web\chrome.py", line 1428, in render_template
    fragment, iterable, method)
  File "build\bdist.win32\egg\trac\web\chrome.py", line 1520, in _render_jinja_template
    iterable)
  File "build\bdist.win32\egg\trac\web\chrome.py", line 1633, in generate_template_stream
    bytes = template.render(data).encode('utf-8')
  File "C:\Python27\lib\site-packages\jinja2\environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "C:\Python27\lib\site-packages\jinja2\environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "c:\Trac\.egg-cache\trac-1.3.3dev-py2.7.egg-tmp\trac\ticket\templates\report_view.html", line 12, in top-level template code
    # extends 'layout.html'
  File "c:\Trac\.egg-cache\trac-1.3.3dev-py2.7.egg-tmp\trac\templates\layout.html", line 12, in top-level template code
    # import "macros.html" as jmacros with context
  File "c:\Trac\.egg-cache\trac-1.3.3dev-py2.7.egg-tmp\trac\templates\theme.html", line 22, in top-level template code
    # block body
  File "c:\Trac\.egg-cache\trac-1.3.3dev-py2.7.egg-tmp\trac\templates\theme.html", line 128, in block "body"
    # block content
  File "c:\Trac\.egg-cache\trac-1.3.3dev-py2.7.egg-tmp\trac\ticket\templates\report_view.html", line 247, in block "content"
    format_time(from_utimestamp(int(cell.value))) if cell.value != ''
UndefinedError: 'int' is undefined

Attachments (0)

Change History (7)

comment:2 by Jun Omae, 5 years ago

Milestone: 1.3.4
Owner: set to Jun Omae
Status: newassigned
Version: 1.3dev

Thanks for the reporting. We should use expression|int instead of int(expression).

-              format_time(from_utimestamp(int(cell.value))) if cell.value != ''
+              format_time(from_utimestamp(cell.value|int)) if cell.value != ''

comment:3 by Jun Omae, 5 years ago

Proposed changes in [aa4370467/jomae.git].

in reply to:  3 ; comment:4 by Jun Omae, 5 years ago

Replying to Jun Omae:

Proposed changes in [aa4370467/jomae.git].

Revised the branch to fix test failing when Babel is unavailable, [620ec8127/jomae.git].

in reply to:  4 comment:5 by Jun Omae, 5 years ago

Proposed changes in [aa4370467/jomae.git].

Revised the branch to fix test failing when Babel is unavailable, [620ec8127/jomae.git].

Revised again, due to failing on PostgreSQL, [7f1f71fd6/jomae.git].

comment:6 by Jun Omae, 5 years ago

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

Fixed in [16896].

comment:7 by Ryan J Ollos, 4 years ago

Internal Changes: modified (diff)
Release Notes: modified (diff)

Modify Ticket

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