Fw: Re: [Zope] startup error
I didn't know that was logic :) Now I am really confused. What part of the "try...except...else" logic is failing to get the error message. CODE SNIPPET: try: # Try to use custom storage m=imp.find_module('custom_zodb',[getConfiguration().instancehome]) except: # if there is no custom_zodb,use the config file specified # databases configuration = getConfiguration() DB = configuration.dbtab.getDatabase('/', is_root=1) Globals.BobobaseName = DB.getName() else: m=imp.load_module('Zope.custom_zodb', m[0], m[1], m[2]) if hasattr(m,'DB'): DB=m.DB else: storage = m.Storage DB = ZODB.DB(storage) RESULTING ERROR MESSAGE: Traceback (most recent call last): File "/opt/zope/lib/python/Zope/App/startup.py", line 52, in startup m=imp.find_module('custom_zodb',[INSTANCE_HOME]) ImportError: No module named custom_zodb
Michael Long wrote at 2003-8-13 18:27 -0400:
Isn't there a "try: ... except: " around this?
It is actually a "try: ... except: ... else: " which I don't think is valid.
Why not?
The "else:" clause is executed when there is no exception.
With the "try: ... except:", you should not see exceptions from "...".
Dieter
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Michael Long wrote at 2003-8-14 16:12 -0400:
Now I am really confused. What part of the "try...except...else" logic is failing to get the error message.
CODE SNIPPET:
try: # Try to use custom storage m=imp.find_module('custom_zodb',[getConfiguration().instancehome]) except: ... RESULTING ERROR MESSAGE:
Traceback (most recent call last): File "/opt/zope/lib/python/Zope/App/startup.py", line 52, in startup m=imp.find_module('custom_zodb',[INSTANCE_HOME]) ImportError: No module named custom_zodb
When you look carefully, you will see that the traceback does not come from the above mentioned code snippet as the exception raising line is similar but not identical. Identify the true exception raising line and check whether there is a "try: ... except: ..." around. By the way: your code snippet indicates very recent code while the traceback indicates much older code. Maybe, your Zope loads Python modules from an unanticipated place. Dieter
participants (2)
-
Dieter Maurer -
Michael Long