Hi I have a small filesystem based python script which I use to get some variables to use in a page template. The script collects the variable and returns a dictionary to by used in the page template. A snippet of the the script: ## Script (Python) "getAgendaVars" ##parameters= ##title=get variables for the Agenda ## vars = {} if context.meta_type == 'Media Manager Live Event': # get title vars['title'] = 'Sub Event Title' # stuff removed for clarity elif context.meta_type == 'Media Sub Event': # get title vars['title'] = context.title # stuff removed for clarity else: raise "Wrong meta type %s" % context.meta_type And a snippet from the page template: <span tal:define="global vars here/getAgendaVars;" /> <input type="text" name="title" value="title" tal:attributes="value vars/title|nothing"> This works excellent for a while, then if I leave it for some time I get: Error Type: TALESError Error Value: exceptions.RuntimeError on Products/MyMediaManager/zpt_skins/getAgendaVars.py has errors. in "standard:'here/getAgendaVars'", at line 5, column 1 And if I reload the page I get: Error Type: TALESError Error Value: exceptions.NameError on global name 'context' is not defined in "standard:'here/getAgendaVars'", at line 5, column 1 I have rewritten the python script several times and I totally baffled about whats happening -- Regards, Thomas Olsen http://www.tarpit.dk
Thomas Olsen writes:
This works excellent for a while, then if I leave it for some time I get:
Error Type: TALESError Error Value: exceptions.RuntimeError on Products/MyMediaManager/zpt_skins/getAgendaVars.py has errors. in "standard:'here/getAgendaVars'", at line 5, column 1
And if I reload the page I get:
Error Type: TALESError Error Value: exceptions.NameError on global name 'context' is not defined in Do you use Python 2.1.x (x <= 1) or Zope 2.4.x (x<=3)?
Looks like a severe bug, potentially caused by memory corruption. The above configurations are known to be able to cause memory corruptions... Dieter
On Friday 22 March 2002 23:14, Dieter Maurer wrote:
Thomas Olsen writes:
Error Type: TALESError Error Value: exceptions.NameError on global name 'context' is not defined in
Do you use Python 2.1.x (x <= 1) or Zope 2.4.x (x<=3)?
Yes. I use python 2.1.1 and zope from cvs tagged with Zope-2_5-branch.
Looks like a severe bug, potentially caused by memory corruption. The above configurations are known to be able to cause memory corruptions...
I'll try a newer python. Is it 2.1.2 that is recommended for zope 2.5? -- Regards, Thomas OLsen
participants (2)
-
Dieter Maurer -
Thomas Olsen