Opened 6 years ago

Closed 6 years ago

# [Patch] "Local variable referenced before assignment" error (r10732)

Reported by: Owned by: Ryan J Ollos Chris Nelson high TracJsGanttPlugin normal 0.11

### Description

Following some change to a ticket, the Gantt chart stopped displaying. This occurs with r10732 of the plugin. We now see this:

I hope to send you a patch shortly.

### comment:1 Changed 6 years ago by Ryan J Ollos

Here is the traceback.

2011-10-15 15:16:29,216 Trac[formatter] ERROR: Macro TracJSGanttChart(milestone=M1 - I11, lwidth=600, colorBy=owner, expandClosedTickets=0, startDate=0, endDate=0, res=0) failed:
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/Trac-0.11.7-py2.6.egg/trac/wiki/formatter.py", line 484, in _macro_formatter
return macro.process(args, in_paragraph=True)
File "/usr/lib/python2.6/site-packages/Trac-0.11.7-py2.6.egg/trac/wiki/formatter.py", line 180, in process
text = self.processor(text)
File "/usr/lib/python2.6/site-packages/Trac-0.11.7-py2.6.egg/trac/wiki/formatter.py", line 167, in _macro_processor
text)
File "/usr/lib/python2.6/site-packages/Trac_jsGantt-0.9_r10732-py2.6.egg/tracjsgantt/tracjsgantt.py", line 1108, in expand_macro
File "/usr/lib/python2.6/site-packages/Trac_jsGantt-0.9_r10732-py2.6.egg/tracjsgantt/tracjsgantt.py", line 735, in _schedule_tasks
File "/usr/lib/python2.6/site-packages/Trac_jsGantt-0.9_r10732-py2.6.egg/tracjsgantt/tracjsgantt.py", line 628, in _schedule_task_alap
finish += timedelta(days=7-start.weekday())
UnboundLocalError: local variable 'start' referenced before assignment


### comment:2 Changed 6 years ago by Ryan J Ollos

Summary: "Local variable referenced before assignment" error (r10732) → [Patch] "Local variable referenced before assignment" error (r10732)

Here is the patch.

### comment:3 follow-up:  5 Changed 6 years ago by Ryan J Ollos

I've created a fork of this project at BitBucket so that I have a place to push my changes. I haven't used Git before, so please let me know if you have any suggestions on how I can do this better. Will it be easier for you to pull in this changes if I point you to the commit hash that contains the patch?

Here is the URL for the changeset that contains the patch for this ticket: https://bitbucket.org/rjollos/tracjsganttplugin/changeset/612501ab2531

### comment:4 Changed 6 years ago by Chris Nelson

Status: new → assigned

### comment:5 in reply to:  3 ; follow-up:  6 Changed 6 years ago by Chris Nelson

I've created a fork of this project at BitBucket so that I have a place to push my changes.

I hope you mean clone, let's not diverge!

I haven't used Git before, so please let me know if you have any suggestions on how I can do this better.

Git hurts your head for a couple of months then you wonder how you ever lived without it.

Will it be easier for you to pull in this changes if I point you to the commit hash that contains the patch?

I dunno. Downloading a patch from TH is easy enough for me but I should be able to add BitBucket as an additional remote to my repo and cherry-pick your changes from there so that might be easier.

Here is the URL for the changeset that contains the patch for this ticket: https://bitbucket.org/rjollos/tracjsganttplugin/changeset/612501ab2531

I'll see if I can figure out how to use that.

### comment:6 in reply to:  5 Changed 6 years ago by Ryan J Ollos

I hope you mean clone, let's not diverge!

Well, yes I suppose I do (now that I stop and think about the actual meanings of those words ;). I'm anticipating pushing up changes to the BitBucket repository and associating each with a ticket so that you can pull in the ones that you want included in your plugin. So we could diverge perhaps slightly if you don't want to include a particular change, but any customization of your plugin would just be for my own use (e.g. #8947) in order to meet the demands my team has, and I don't intend to "advertize" my clone on trac-hacks or elsewhere. For one, although I'm happy to fix bugs and try to help you support other users, I don't want to support users on any forks of the plugin. And in general, I think that everyone doing there own thing and posting it all over trac-hacks just leads to us having a very disorganized community and is not something I want to promote.

### comment:8 Changed 6 years ago by Ryan J Ollos

Resolution: → fixed assigned → closed

### Modify Ticket

Change Properties