[Zope-CMF] IndexError: list index out of range

Tres Seaver tseaver@palladion.com
Mon, 13 Aug 2001 21:15:44 -0400


Norman Khine wrote:

> Hi,
> This afternoon I got the latest checkout from the cvs tree, and got this
> error upon restart of server
> 
> error(200) Zope Couldn't install CMFCore
> Traceback (innermost last):
>  File /usr/local/zope/lib/python/OFS/Application.py, line 69, in
> install_products
>     (Object: ApplicationDefaultPermissions)
>     (Info: CMFCore)
>  File /usr/local/zope/lib/python/Products/CMFCore/__init__.py, line 175, in
> initialize
>  File /usr/local/zope/lib/python/App/ProductContext.py, line 377, in
> registerHelp
>  File /usr/local/zope/lib/python/HelpSys/APIHelpTopic.py, line 141, in
> __init__
> 
>      (Object: HelpTopicBase)
>  IndexError: list index out of range
> 
> although the CMF product is not shown as broken?!? in the ZMI
> 
> my set up:
> 
> Zope Version  Zope 2.3.2 (source release, python 1.5.2, linux2)
> Python Version  2.1 (#1, Jun 2 2001, 10:12:16) [GCC 2.95.2 19991024
> (release)]
> System Platform  freebsd4
> Process Id  613 (151181312)
> Running For  47 min 46 sec

In order to lay the groundwork for migrating the CMF to the new

"Zope Component Architecture",

we began fleshing out the interface declarations in the CMF.
Unfortunately, this work had the effect of colliding with a bug
in the HelpSystem's handling of a Python package, when registered
as a help directory:  the registration machinery chokes trying to
load APIs from the __init__.py!

I've patched CMFCore/__init__.py to work around this problem, and

have fixed the help system on both the 2.3 and 2.4 branches and the
head.  Here is the CMF patch:

diff -u -r1.9 __init__.py
--- CMFCore/__init__.py	1 Jun 2001 02:40:37 -0000	1.9
+++ CMFCore/__init__.py	14 Aug 2001 01:39:45 -0000
@@ -171,8 +171,11 @@
      utils.registerIcon(TypesTool.ScriptableTypeInformation,
                         'images/typeinfo.gif', globals())

-    context.registerHelpTitle( 'CMF Core Help' )
-    context.registerHelp(directory='interfaces')
+    try:
+        context.registerHelpTitle( 'CMF Core Help' )
+        context.registerHelp(directory='interfaces')
+    except: # AARGH!!
+        pass

      utils.ToolInit( 'CMF Core Tool'
                    , tools=tools

Or you could 'cvs up' to get it.


Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com