Modify

Opened 13 years ago

Closed 13 years ago

#9441 closed defect (fixed)

Error: unsupported operand type(s) for *: 'NoneType' and 'float'

Reported by: Ryan J Ollos Owned by: Chris Nelson
Priority: normal Component: TracJsGanttPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

I have a test configuration in which the worked and estimate fields are not defined.

I get the following traceback with r10837:

01:08:26 PM Trac[formatter] ERROR: Macro TracJSGanttChart(milestone=milestone1) failed: 
Traceback (most recent call last):
  File "/home/rjollos/Workspace/th9300/trac-0.11-stable/trac/wiki/formatter.py", line 491, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "/home/rjollos/Workspace/th9300/trac-0.11-stable/trac/wiki/formatter.py", line 180, in process
    text = self.processor(text)
  File "/home/rjollos/Workspace/th9300/trac-0.11-stable/trac/wiki/formatter.py", line 167, in _macro_processor
    text)
  File "/home/rjollos/Workspace/tracjsganttplugin/0.11/tracjsgantt/tracjsgantt.py", line 1105, in expand_macro
    tasks = self._add_tasks(options)
  File "/home/rjollos/Workspace/tracjsganttplugin/0.11/tracjsgantt/tracjsgantt.py", line 1063, in _add_tasks
    self._schedule_tasks(options)
  File "/home/rjollos/Workspace/tracjsganttplugin/0.11/tracjsgantt/tracjsgantt.py", line 729, in _schedule_tasks
    _schedule_task_alap(t)
  File "/home/rjollos/Workspace/tracjsganttplugin/0.11/tracjsgantt/tracjsgantt.py", line 635, in _schedule_task_alap
    hours = self._workHours(options, t)
  File "/home/rjollos/Workspace/tracjsganttplugin/0.11/tracjsgantt/tracjsgantt.py", line 509, in _workHours
    hours = est * self.hpe
TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'

I'm not sure how you want to deal with this, but it seems like you can either set estimate to 0 rather than None or add a conditional near the end of the method:

if est:
    hours = est * self.hpe
else:
    ...

Attachments (0)

Change History (4)

comment:1 Changed 13 years ago by Ryan J Ollos

#9508 is essentially a duplicate of this ticket.

comment:2 Changed 13 years ago by Chris Nelson

(In [10864]) Use default estimate if estimate field not configured. Refs #9441.

comment:3 Changed 13 years ago by Chris Nelson

Status: newassigned

This works for me when I remove my configuration for the estimate and worked fields.

comment:4 Changed 13 years ago by Chris Nelson

Resolution: fixed
Status: assignedclosed

No complaints in over a week. Assume this is working as well for others as it is for me.

Modify Ticket

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