| UnboundLocalErrorlocal variable 'buttons' referenced before assignment | Please include this information in your bug reports!: Python Python 2.4.4: /usr/bin/python2.4 Linux fachschaft 2.6.18-6-686 #1 SMP Thu Aug 20 21:56:59 UTC 2009 i686 MoinMoin Release 1.3.4 [Revision 1.3.4 release] Sun Nov 22 05:18:43 2009 |
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
| /home/sc04/moin-1.3.4/MoinMoin/request.py in run(self=<MoinMoin.request.RequestFastCGI instance>) |
| 863 if self.cfg.allow_extended_names: |
| 864 self.page = Page(self, pagename) |
| 865 self.page.send_page(self, count_hit=1) |
| 866 else: |
| 867 # TODO: kill this. Why disable allow extended names? |
| self = <MoinMoin.request.RequestFastCGI instance>, self.page = <MoinMoin.Page.Page instance>, self.page.send_page = <bound method Page.send_page of <MoinMoin.Page.Page instance>>, count_hit undefined |
| /home/sc05/moin-1.3.4/MoinMoin/Page.py in send_page(self=<MoinMoin.Page.Page instance>, request=<MoinMoin.request.RequestFastCGI instance>, msg='', **keywords={'count_hit': 1}) |
| 1143 else: |
| 1144 # parse the text and send the page content |
| 1145 self.send_page_content(request, Parser, body, format_args=pi_formatargs, do_cache=do_cache) |
| 1146 |
| 1147 # check for pending footnotes |
| self = <MoinMoin.Page.Page instance>, self.send_page_content = <bound method Page.send_page_content of <MoinMoin.Page.Page instance>>, request = <MoinMoin.request.RequestFastCGI instance>, Parser = <class MoinMoin.parser.wiki.Parser>, body = u'\n[[ChangePassword]]\n', format_args undefined, pi_formatargs = '', do_cache = 1 |
| /home/sc05/moin-1.3.4/MoinMoin/Page.py in send_page_content(self=<MoinMoin.Page.Page instance>, request=<MoinMoin.request.RequestFastCGI instance>, Parser=<class MoinMoin.parser.wiki.Parser>, body=u'\n[[ChangePassword]]\n', needsupdate=0, format_args='', do_cache=1) |
| 1306 __file__ = os.path.join(moinmodule.__loader__.archive, 'dummy') |
| 1307 |
| 1308 exec code |
| 1309 except 'CacheNeedsUpdate': |
| 1310 # if something goes wrong, try without caching |
| code = <code object ? at 0xb6e329e0, file "ChangePassword", line 2> |
| /var/www/sommercampus05/wiki/ChangePassword |
| /home/sc04/moin-1.3.4/MoinMoin/formatter/base.py in macro(self=<MoinMoin.formatter.text_html.Formatter instance>, macro_obj=<MoinMoin.wikimacro.Macro instance>, name=u'ChangePassword', args=None) |
| 226 def macro(self, macro_obj, name, args): |
| 227 # call the macro |
| 228 return macro_obj.execute(name, args) |
| 229 |
| 230 def _get_bang_args(self, line): |
| macro_obj = <MoinMoin.wikimacro.Macro instance>, macro_obj.execute = <bound method Macro.execute of <MoinMoin.wikimacro.Macro instance>>, name = u'ChangePassword', args = None |
| /home/sc04/moin-1.3.4/MoinMoin/wikimacro.py in execute(self=<MoinMoin.wikimacro.Macro instance>, macro_name=u'ChangePassword', args=None) |
| 99 macro = wikiutil.importPlugin(self.request.cfg, 'macro', macro_name) |
| 100 if macro: |
| 101 return macro(self, args) |
| 102 |
| 103 builtins = vars(self.__class__) |
| macro = <function execute>, self = <MoinMoin.wikimacro.Macro instance>, args = None |
| /home/sc05/sc05-wiki/data/plugin/macro/ChangePassword.py in execute(macro=<MoinMoin.wikimacro.Macro instance>, args=None) |
| 137 # return UserSettings(request).asHTML() |
| 138 |
| 139 |
| 140 def execute(macro, args): |
| 141 return macro.formatter.rawHTML(UserSettings(macro).asHTML()) |
| macro = <MoinMoin.wikimacro.Macro instance>, macro.formatter = <MoinMoin.formatter.text_html.Formatter instance>, macro.formatter.rawHTML = <bound method Formatter.rawHTML of <MoinMoin.formatter.text_html.Formatter instance>>, global UserSettings = <class wikiconfig.plugin.macro.ChangePassword.UserSettings>, ).asHTML undefined |
| /home/sc05/sc05-wiki/data/plugin/macro/ChangePassword.py in asHTML(self=<wikiconfig.plugin.macro.ChangePassword.UserSettings instance>) |
| 121 # Add buttons |
| 122 button_cell = [] |
| 123 for name, label in buttons: |
| 124 button_cell.extend([ |
| 125 html.INPUT(type="submit", name=name, value=label), |
| name undefined, label undefined, buttons undefined |
UnboundLocalError: local variable 'buttons' referenced before assignment
__doc__ =
'Local name referenced but not bound to a value.'
__getitem__ =
<bound method UnboundLocalError.__getitem__ of <exceptions.UnboundLocalError instance>>
__init__ =
<bound method UnboundLocalError.__init__ of <exceptions.UnboundLocalError instance>>
__module__ =
'exceptions'
__str__ =
<bound method UnboundLocalError.__str__ of <exceptions.UnboundLocalError instance>>
args =
("local variable 'buttons' referenced before assignment",)