Modify

Opened 2 years ago

Closed 2 years ago

#9285 closed defect (wontfix)

error: global name 'pid' is not defined

Reported by: falkb Owned by: ChrisNelson
Priority: normal Component: TracJsGanttPlugin
Severity: normal Keywords:
Cc: rjollos 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 2 years ago by falkb

  • Trac Release changed from 0.11 to 0.12

comment:2 Changed 2 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 2 years ago by rjollos

  • Cc rjollos added

comment:4 Changed 2 years ago by ChrisNelson

  • Status changed from new to assigned

comment:5 Changed 2 years ago by ChrisNelson

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

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

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from ChrisNelson. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.