Modify

Opened 17 years ago

Closed 17 years ago

#1965 closed defect (fixed)

TypeError from impl.py, line 91

Reported by: anonymous Owned by: Markus Pelkonen
Priority: normal Component: TimeVisualizerPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

I have just test the TimingAndEstimationPlugin and different time visualizer plugins, incl. timevisualizerplugin. I use Trac 0.10.4 and timingandestimationplugin 0.4.8 but have TracBurndown 01.06.10 installed and running as well (not working properly).

After installation procedure I get error trying to access results via both link and macro ways. This is stack trace:

Traceback (most recent call last):

File "/usr/lib/python2.5/site-packages/TraM-0.1-py2.5.egg/tram/main.py", line 252, in dispatch_request

dispatcher.dispatch(req)

File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 237, in dispatch

resp = chosen_handler.process_request(req)

File "build/bdist.linux-i686/egg/tractimevisualizerplugin/pluginwrapper.py", line 31, in process_request

return impl.process_request(self, req)

File "build/bdist.linux-i686/egg/tractimevisualizerplugin/impl.py", line 275, in process_request

req.write(build_svg(db, req.args, debug))

File "build/bdist.linux-i686/egg/tractimevisualizerplugin/impl.py", line 153, in build_svg

tickets[ticket]estimatedhours? = tofloat(oldvalue) # we iterate backwards, thus old value

File "build/bdist.linux-i686/egg/tractimevisualizerplugin/impl.py", line 91, in tofloat

return float(obj) #fallback

TypeError: float() argument must be a string or a number

Attachments (0)

Change History (6)

comment:1 Changed 17 years ago by anonymous

I test to return 0.0 at return float(obj) #fallback and it's working. Probably I have no data for some of the dates in rendered period.

comment:2 Changed 17 years ago by Markus Pelkonen

Could u print the data passed for tofloat and see what data type it is?

This sounds very odd, because the SQL in code is very simple - not using any sql functions to alter data. And ticket_change table schema uses text for column:

sqlite>.schema ticket_change
CREATE TABLE ticket_change (
    ticket integer,
    time integer,
    author text,
    field text,
    oldvalue text,
    newvalue text,
    UNIQUE (ticket,time,field)
);

The only possible problem I see, could be that the oldvalue is NULL. Could U try to check it:

select * from ticket_change where oldvalue is NULL

comment:3 Changed 17 years ago by Markus Pelkonen

Oh, I had to test it myself - if old value is NULL, one gets the traceback mentioned. I'm not sure what happens if is empty (for some reason), so I'll test these things in detail & provide new version ASAP (not today).

comment:4 Changed 17 years ago by Markus Pelkonen

I had to fix this immediately and create new release, see [2592].

Please close this task if this fixes the problem. If not, please give me more information.

comment:5 in reply to:  4 Changed 17 years ago by anonymous

Replying to mape:

I had to fix this immediately and create new release, see [2592].

Please close this task if this fixes the problem. If not, please give me more information.

I test it and it's work but in my opinion it is better to return 0.0 in all cases other than processed ones. Simply put return 0.0 at the end (w/o if statement). Tanks a lot and sorry for stupid request but I have no experience in Python.

chradev

comment:6 Changed 17 years ago by anonymous

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Markus Pelkonen.
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.