NameError: global name 'Project' is not defined
Hi, I have gotten this on two different machine. I created a Product name Project following the example in the Zope Book. When i make a folder in the root directory and then add this product, i get the following error when i type in an ID and click Add. I'm running Zope-2.4.3-win32-x86 on windows 2000. Last week, on a third machine, it worked fine, but today, on two different boxes, i get this error. Any thoughts? Thanks, mark Site Error An error was encountered while publishing this resource. NameError Sorry, a site error occurred. Traceback (innermost last): File C:\zz\zope\Southern\lib\python\ZPublisher\Publish.py, line 223, in publish_module File C:\zz\zope\Southern\lib\python\ZPublisher\Publish.py, line 187, in publish File C:\zz\zope\Southern\lib\python\Zope\__init__.py, line 226, in zpublisher_exception_hook (Object: Project_factory) File C:\zz\zope\Southern\lib\python\ZPublisher\Publish.py, line 171, in publish File C:\zz\zope\Southern\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: Project_add) File C:\zz\zope\Southern\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: Project_add) File C:\zz\zope\Southern\lib\python\OFS\DTMLMethod.py, line 199, in __call__ (Object: Project_add) File C:\zz\zope\Southern\lib\python\DocumentTemplate\DT_String.py, line 546, in __call__ (Object: Project_add) File C:\zz\zope\Southern\lib\python\DocumentTemplate\DT_With.py, line 133, in render (Object: Project.createInObjectManager(REQUEST['id'], REQUEST)) File C:\zz\zope\Southern\lib\python\DocumentTemplate\DT_Util.py, line 231, in eval (Object: Project.createInObjectManager(REQUEST['id'], REQUEST)) (Info: REQUEST) File <string>, line 2, in f (Object: guarded_getitem) NameError: global name 'Project' is not defined
Mark Lilly writes:
... When i make a folder in the root directory and then add this product, i get the following error when i type in an ID and click Add. ... Site Error An error was encountered while publishing this resource. NameError Sorry, a site error occurred. Traceback (innermost last): File C:\zz\zope\Southern\lib\python\ZPublisher\Publish.py, line 223, in publish_module File C:\zz\zope\Southern\lib\python\ZPublisher\Publish.py, line 187, in publish File C:\zz\zope\Southern\lib\python\Zope\__init__.py, line 226, in zpublisher_exception_hook (Object: Project_factory) File C:\zz\zope\Southern\lib\python\ZPublisher\Publish.py, line 171, in publish .... File C:\zz\zope\Southern\lib\python\DocumentTemplate\DT_Util.py, line 231, in eval (Object: Project.createInObjectManager(REQUEST['id'], REQUEST)) (Info: REQUEST) File <string>, line 2, in f (Object: guarded_getitem) NameError: global name 'Project' is not defined I have seen a similar report recently (--> mailing list archives).
I must say, I do not know what is wrong. Apparently, everything is as it should be. With one exception: The traceback contains a strange entry: "zpublisher_exception_hook". This suggests that what you see is a secondary exception. These secondary errors make analysis of the primary error difficult. When I run into such a case, I modify "ZPublisher/Publish.py" near line 106 in the following way: if transactions_manager: transactions_manager.abort() # DM import traceback; traceback.print_exc() if err_hook is not None: This prints the primary exception to standard error - for analysis. Be aware, you will get lots on exceptions printed that are harmless: "Unauthorized", "Redirect" and so on. You are only interested in the output immediately before your error occurs. Dieter
participants (2)
-
Dieter Maurer -
Mark Lilly