[Zope] NameError (global name 'namespace' is not defined)

Dieter Maurer dieter@handshake.de
Fri, 7 Dec 2001 23:37:41 +0100


Ronald L. Chichester writes:
 > Okay, here is a little more diagnostic information.  The 'namespace'
 > that Zope is complaining about is in the following code:
 > ...
 > vars = namespace(contents=contents)
 > 
 > -------------
 > 
 > As I said before, the above code works just fine in Zope 2-3-1. 
 > However, it fails (gets the NameError) in both versions 2-4-2 and
 > 2-4-3.  Is this because Zope went to python 2.x instead of 1.5?
No and yes.

  Python 2.1 made it possible to rewrite Zope's security subsystem
  to get it much clearer and more efficient.

  "namespace" is a "TemplateDict" method ("TemplateDict"
  is the class name for Zope's DTML namespace).
  It is valid only with a namespace object.

  As in a Python Script, there is no such natural object,
  the "namespace" (and other true namespace methods, such
  as e.g. "render") have probably been removed...


Dieter