Description

Describe the bug... Setting up moinmoin with mod_python using farmconfig.py and its regular expressions causes a moinmoin to be unstabele.

Regular expression suggested in the farmconfig.py does not provide enough examples/details to general user. Examples set provide quick fix to naming of the wiki website and file structure and do not promote easy configuration or "zero configuration". Requireing a (non-general knowladge) Regular Expression to be part of general configuration is bug. Name convetions and wikipage access on multiple domains are not addressed at all (localhost, 192.168.0.1, mycompany.localnetwork,mydomain.com, mydomain.net, mydomain.org)

Steps to reproduce

  1. Changing any configuration in formconfig under wikis = [ causes unexpected errors.

Change regular expression to: r".*$" causes

error

nothing to repeat

If you want to report a bug, please save this page and attach it to your bug report.

#

/usr/lib/python2.4/sre.py in _compile (*key=('(?P<mywiki>?.*$)', 0))

   1. 225 p = sre_compile.compile(pattern, flags)
   2. 226 except error, v:
   3. 227 raise error, v # invalid expression
   4. 228 if len(_cache) >= _MAXCACHE:
   5. 229 _cache.clear()

    * global error = <class sre_constants.error>
    * v = <sre_constants.error instance>

But then if reloaded few times wiki decides to work. There is no way to predict its behavior because base installation design is unstable.

Example

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

   1.

      /usr/lib/python2.4/site-packages/MoinMoin/request.py in __init__ (self=<MoinMoin.request.RequestModPy object>, req=<mp_request object>)
         1. 1863 env=req.subprocess_env
         2. 1864 self._setup_vars_from_std_env(env)
         3. 1865 RequestBase.__init__(self)
         4. 1866
         5. 1867 except Exception, err:
          * global RequestBase = <class 'MoinMoin.request.RequestBase'>
          * RequestBase.__init__ = <unbound method RequestBase.__init__>
          * self = <MoinMoin.request.RequestModPy object>
   2.

      /usr/lib/python2.4/site-packages/MoinMoin/request.py in __init__ (self=<MoinMoin.request.RequestModPy object>, properties={})
         1. 111 # order is important here!
         2. 112 self.__dict__.update(properties)
         3. 113 self._load_multi_cfg()
         4. 114
         5. 115 # Set decode charsets. Input from the user is always in
          * self = <MoinMoin.request.RequestModPy object>
          * self._load_multi_cfg = <bound method RequestModPy._load_multi_cfg of <MoinMoin.request.RequestModPy object>>
   3.

      /usr/lib/python2.4/site-packages/MoinMoin/request.py in _load_multi_cfg (self=<MoinMoin.request.RequestModPy object>)
         1. 240 if not hasattr(self, 'cfg'):
         2. 241 from MoinMoin import multiconfig
         3. 242 self.cfg = multiconfig.getConfig(self.url)
         4. 243
         5. 244 def setAcceptedCharsets(self, accept_charset):
          * self = <MoinMoin.request.RequestModPy object>
          * self.cfg undefined
          * multiconfig = <module 'MoinMoin.multiconfig' from '/usr/lib/python2.4/site-packages/MoinMoin/multiconfig.pyc'>
          * multiconfig.getConfig = <function getConfig>
          * self.url = '192.168.254.79/mywiki/'
   4.

      /usr/lib/python2.4/site-packages/MoinMoin/multiconfig.py in getConfig (url='192.168.254.79/mywiki/')
         1. 147 @return: config object for specific wiki
         2. 148 """
         3. 149 configName = _getConfigName(url)
         4. 150 try:
         5. 151 config = _config_cache[configName]
          * configName undefined
          * global _getConfigName = <function _getConfigName>
          * url = '192.168.254.79/mywiki/'
   5.

      /usr/lib/python2.4/site-packages/MoinMoin/multiconfig.py in _getConfigName (url='192.168.254.79/mywiki/')
         1. 122 def _getConfigName(url):
         2. 123 """ Return config name for url or raise """
         3. 124 match = _url_re().match(url)
         4. 125 if not (match and match.groups()):
         5. 126 msg = '''
          * match undefined
          * global _url_re = <function _url_re>
          * ).match undefined
          * url = '192.168.254.79/mywiki/'
   6.

      /usr/lib/python2.4/site-packages/MoinMoin/multiconfig.py in _url_re ()
         1. 66 pattern = '|'.join([r'(?P<%s>%s)' % (name, regex)
         2. 67 for name, regex in farmconfig.wikis])
         3. 68 _url_re_cache = re.compile(pattern)
         4. 69 except AttributeError:
         5. 70 msg = """
          * global _url_re_cache = None
          * global re = <module 're' from '/usr/lib/python2.4/re.pyc'>
          * re.compile = <function compile>
          * pattern = '(?P<mywiki>?.*$)'
   7.

      /usr/lib/python2.4/sre.py in compile (pattern='(?P<mywiki>?.*$)', flags=0)
         1. 178 def compile(pattern, flags=0):
         2. 179 "Compile a regular expression pattern, returning a pattern object."
         3. 180 return _compile(pattern, flags)
         4. 181
         5. 182 def purge():
          * global _compile = <function _compile>
          * pattern = '(?P<mywiki>?.*$)'
          * flags = 0
   8.

      /usr/lib/python2.4/sre.py in _compile (*key=('(?P<mywiki>?.*$)', 0))
         1. 225 p = sre_compile.compile(pattern, flags)
         2. 226 except error, v:
         3. 227 raise error, v # invalid expression
         4. 228 if len(_cache) >= _MAXCACHE:
         5. 229 _cache.clear()
          * global error = <class sre_constants.error>
          * v = <sre_constants.error instance>

error

nothing to repeat

    * args = ('nothing to repeat',)

System Details

    * Date: Mon, 20 Nov 2006 15:26:38 +0000
    * Platform: Linux mis7 2.6.15-27-386 #1 PREEMPT Sat Sep 16 01:51:59 UTC 2006 i686
    * Python: Python 2.4.3 (/usr/bin/python)
    * MoinMoin: Release 1.5.2 (release)

Details

MoinMoin Version

|| OS and Version |Linux| |Ubuntu stable|

Python Version |2.4|

|| Server Setup |apache2| |mod_python|

Server Details |http://moinmoin.wikiwikiweb.de/MoinMoinPackages/DebianLinux?highlight=%28debian%29#head-1b39156a3daa5689018369273b567ce421eb6313|

Language you are using the wiki in (set in the browser/UserPreferences) |en|

Workaround

Discussion

Some suggestions:

Plan


CategoryMoinMoinNoBug

MoinMoin: MoinMoinBugs/RegularExpression (last edited 2008-03-18 18:34:39 by JohannesBerg)