[Product-Developers] Re: Need Help with External Method

Maurits van Rees m.van.rees at zestsoftware.nl
Wed Sep 2 07:22:39 UTC 2009

Mark Phillips, on 2009-09-02:
> Maurits,
> Thanks for the pointer...I forgot about how the error log filters out
> certain errors.
> The error said that it could not find the method in my python file. Well, it
> is there. Then I realized I was cutting and pasting the ID, method name,
> etc. from the ahs site to the ahs_dev site. I inadvertently added a trailing
> space, so the method could not be found. I would call this a bug, since I
> believe a method name in python cannot have a trailing (or leading) spaces.
> In the traceback below, and you can see the trailing space in the method
> name that was picked up by the add external method form:
> Traceback (innermost last):
>   Module ZPublisher.Publish, line 115, in publish
>   Module ZPublisher.mapply, line 88, in mapply
>   Module ZPublisher.Publish, line 41, in call_object
>   Module Products.ExternalMethod.ExternalMethod, line 59, in
> manage_addExternalMethod
>   Module Products.ExternalMethod.ExternalMethod, line 111, in __init__
>   Module Products.ExternalMethod.ExternalMethod, line 134, in manage_edit
>   Module Products.ExternalMethod.ExternalMethod, line 141, in getFunction
>   Module App.Extensions, line 158, in getObject
>    - __traceback_info__:
> ('/opt/Plone-2.5.5/zeocluster/client1/Extensions/WorkflowEmailScripts.py',
> 'WorkflowEmailScripts')
> NotFound: The specified object, <em>edit_new_content </em>, was not
> found in module, <em>WorkflowEmailScripts</em>.
> If my understanding of python is correct, shouldn't manage_addExternalMethod
> stip off leading and trailing white space from the id, title, module, and
> function names passed into the method? In ExternalMethod,
> manage_addExternalMethod does this:
>     id=str(id)
>     title=str(title)
>     module=str(module)
>     function=str(function)
> should it be?
>     id=str(id).strip()
>     title=str(title).strip()
>     module=str(module).strip()
>     function=str(function).strip()

Such a change would make sense for me.

> Thanks again for shining a light on an otherwise murky road to
> understanding! How would I submit a bug report, if you think there is a bug
> here. Just a newbie trying to give back.

Products.ExternalMethod is part of Zope 2.  The tracker for that is on
launchpad: https://bugs.launchpad.net/zope2/

Maurits van Rees | http://maurits.vanrees.org/
            Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]

More information about the Product-Developers mailing list