Opened 3 years ago

Closed 3 years ago

#9441 closed defect (fixed)

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

Reported by: rjollos Owned by: ChrisNelson
Priority: normal Component: TracJsGanttPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11


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/", line 491, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "/home/rjollos/Workspace/th9300/trac-0.11-stable/trac/wiki/", line 180, in process
    text = self.processor(text)
  File "/home/rjollos/Workspace/th9300/trac-0.11-stable/trac/wiki/", line 167, in _macro_processor
  File "/home/rjollos/Workspace/tracjsganttplugin/0.11/tracjsgantt/", line 1105, in expand_macro
    tasks = self._add_tasks(options)
  File "/home/rjollos/Workspace/tracjsganttplugin/0.11/tracjsgantt/", line 1063, in _add_tasks
  File "/home/rjollos/Workspace/tracjsganttplugin/0.11/tracjsgantt/", line 729, in _schedule_tasks
  File "/home/rjollos/Workspace/tracjsganttplugin/0.11/tracjsgantt/", line 635, in _schedule_task_alap
    hours = self._workHours(options, t)
  File "/home/rjollos/Workspace/tracjsganttplugin/0.11/tracjsgantt/", 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

Attachments (0)

Change History (4)

comment:1 Changed 3 years ago by rjollos

#9508 is essentially a duplicate of this ticket.

comment:2 Changed 3 years ago by ChrisNelson

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

comment:3 Changed 3 years ago by ChrisNelson

  • Status changed from new to assigned

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

comment:4 Changed 3 years ago by ChrisNelson

  • Resolution set to fixed
  • Status changed from assigned to closed

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

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.