[Zope-dev] A suggestion for changing exception handler when loading 'c' optimisations to make modules more friendly for GAE

Tim Hoffman timh at zute.net
Thu Jul 2 20:39:56 EDT 2009


Hi all

Can I make a suggestion that would make a couple of modules more gae
friendly ;-)
zope.interface and zope.i18nmessageid have 'c' optimisations which
obviously don't work under app engine.


When these modules are imported you get the following exception.

gae/1.333250465889549129/zope/i18nmessageid/_zope_i18nmessageid_message.py",
line 6, in __bootstrap__
    imp.load_dynamic(__name__,__file__)
  File "/base/python_dist/lib/python2.5/py_imp.py", line 116, in load_dynamic
    raise NotImplementedError('This function is not supported on App Engine.')

Unfortunately the code (in this case in zope.i18nmessageid.Message)
does the following which doesn't deal with the Exception
raised by the app engine runtime.


try:
    from _zope_i18nmessageid_message import Message
except ImportError:
    pass

To make it more "gae friendly" I think we should change these occurrences to

try:
    from _zope_i18nmessageid_message import Message
except ImportError, NotImplementedError:
    pass

Regards

Tim


More information about the Zope-Dev mailing list