#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 |
||
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:1 by , 7 years ago
comment:2 by , 7 years ago
| Milestone: | → 1.3.4 |
|---|---|
| Owner: | set to |
| Status: | new → assigned |
| 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 != ''
follow-up: 5 comment:4 by , 7 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].
comment:5 by , 7 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 , 7 years ago
| Release Notes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
Fixed in [16896].



int.intis a builtin.intis mentioned as a builtin, but not in the List of Global Functions that are available in the global scope by default. Maybe this is the problem?as_intwould be available. I'm not sure if that is relevant.