Modify

Opened 12 years ago

Closed 12 years ago

#9285 closed defect (wontfix)

error: global name 'pid' is not defined

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

Description

Came across this traceback:

Traceback (most recent call last):
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 717, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 304, in process
    text = self.processor(text)
  File "build\bdist.win32\egg\trac\wiki\formatter.py", line 291, in _macro_processor
    text)
  File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 1106, in expand_macro
    tasks = self._add_tasks(options)
  File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 1068, in _add_tasks
    self._schedule_tasks(options)
  File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 735, in _schedule_tasks
    _schedule_task_alap(t)
  File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 618, in _schedule_task_alap
    finish = _earliest_successor(t, _ancestor_finish(t))
  File "build\bdist.win32\egg\tracjsgantt\tracjsgantt.py", line 604, in _earliest_successor
    % (t['id'], pid, pid))
NameError: global name 'pid' is not defined

Seems some safety checks are missing in the code

Attachments (0)

Change History (5)

comment:1 Changed 12 years ago by falkb

Trac Release: 0.110.12

comment:2 Changed 12 years ago by falkb

not sure if the logging is as desired now but this makes the chart working again:

  • C:/projects/tracjsganttplugin/0.11/tracjsgantt/tracjsgantt.py

     
    598598                            if start == None or s < start:
    599599                                start = s
    600600                        else:
     601                          pid = int(t[self.fields['parent']])
     602                          if pid != 0:
    601603                            self.env.log.info("""Ticket %s has parent %s
    602604                                                 but %s is not in the chart.
    603605                                                 Ancestor deadlines ignored."""
     
    680682                            if finish == None or f > finish:
    681683                                finish = f
    682684                        else:
     685                          pid = int(t[self.fields['parent']])
     686                          if pid != 0:
    683687                            self.env.log.info("""Ticket %s has parent %s
    684688                                                 but %s is not in the chart.
    685689                                                 Ancestor deadlines ignored."""

comment:3 Changed 12 years ago by Ryan J Ollos

Cc: Ryan J Ollos added; anonymous removed

comment:4 Changed 12 years ago by Chris Nelson

Status: newassigned

comment:5 Changed 12 years ago by Chris Nelson

Resolution: wontfix
Status: assignedclosed

There was a cut-and-paste error in the code but the patch does not address it properly. The messages were revised in [10812].

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.