Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

#5174 closed defect (duplicate)

use of datetime() function in report causes invalid literal for float() error

Reported by: doug@… Owned by: Matthew Good
Priority: normal Milestone:
Component: report system Version:
Severity: normal Keywords: duplicate
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

While trying to create a report that would format dates in CSV for Excel I managed to create a report that crashes the writer and does not allow for editing or deltion.


Python Traceback Traceback (most recent call last):

File "/usr/local/python/lib/python2.4/site-packages/trac/web/main.py", line 393, in dispatch_request

dispatcher.dispatch(req)

File "/usr/local/python/lib/python2.4/site-packages/trac/web/main.py", line 243, in dispatch

resp = chosen_handler.process_request(req)

File "/usr/local/python/lib/python2.4/site-packages/trac/ticket/report.py", line 88, in process_request

resp = self._render_view(req, db, id)

File "/usr/local/python/lib/python2.4/site-packages/trac/ticket/report.py", line 346, in _render_view

valuedate = format_date(cell, tz=req.session.get_timezone())

File "/usr/local/python/lib/python2.4/site-packages/trac/util/datefmt.py", line 86, in format_date

return format_datetime(t, tz, format, gmt)

File "/usr/local/python/lib/python2.4/site-packages/trac/util/datefmt.py", line 76, in format_datetime

t = time.localtime(float(t))

ValueError: invalid literal for float(): 3217572-11-26 12:00:00


I'm quite sure it was the use of datetime() in the following query:

SELECT p.value AS color,

id AS ticket, summary, component, version, milestone, t.type AS type,

(CASE status WHEN 'assigned' THEN owner
' *' ELSE owner END) AS owner,

datetime(time) AS created, changetime AS _changetime, description AS _description, reporter AS _reporter

FROM ticket t LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority' WHERE status IN ('new', 'assigned', 'reopened') ORDER BY p.value, milestone, t.type, time

The biggest problem is that this report now can no longer be edited or deleted.

Attachments (0)

Change History (1)

comment:1 by anonymous, 17 years ago

Keywords: duplicate added
Resolution: duplicate
Status: newclosed

This is a dupe of #4510.

Modify Ticket

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