Description

If there is an ImportError inside the definition of class FarmConfig, the error message is "No module named wikiconfig" and the traceback is unhelpful.

Steps to reproduce

  1. Under "class FarmConfig(DefaultConfig):", insert a statement "import NonexistentModule".

  2. Try to visit a moin page.

Details

traceback1.html

Workaround

Add a hint/faq that nested import errors can be the cause of "No module named wikiconfig".

Copying the wikiconfig.py from the instance to /usr/lib/python2.4/ solved the problem. Should this be considered a bug?

Discussion

aaa.py:

bbb.py: does not exist

>>> __import__('aaa', {}, {})
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "aaa.py", line 1, in ?
    import bbb
ImportError: No module named bbb
>>> __import__('aaa', {}, {})
<module 'aaa' from 'aaa.pyc'>

Happens with py 2.3.5 (maybe also with other 2.3.x). 2.4.x behaves normal.


Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/NestedImportErrorInConfigGivesBadErrorMessage (last edited 2008-06-16 19:31:53 by ThomasWaldmann)