Zope-Dev: Curious Problem
Dylan Reinhardt
python at dylanreinhardt.com
Fri Apr 25 15:24:25 EDT 2003
[ already answered on the Zope list ]
On Fri, 2003-04-25 at 07:58, wrote:
> Hi,
>
> I have a python external method which reads from an external database,
> unpickles a class object, and concatenates some of the object's
> properties into a string which is returned by the external method.
> The class definition is included in the module.
>
> When I run it from the linux prompt in the Extensions directory it
> behaves exactly as it should. The class is successfully unpickled, the
> properties are read and the string is returned.
>
> However, when I set it up as an external method and call it I get the
> infamous:
>
> Error Type: SystemError
> Error Value: Failed to import class MyObject from module __main__
>
> >From my perspective Zope should be 'blissfully unaware' of the
> existence of the class or the instantiation of the object. Since the
> object is only accessed in the external method, the module contains
> the class definition, and only a string is returned, why is this
> happening?
>
> What am I missing here?
>
> Platform: Red Hat 7.3, Python 2.1.3, Zope 2.51
>
> Curious,
>
> Sean
>
> P.S. Also posted to zope-dev but I wanted the 'python' perspective as
> well
More information about the Python-list
mailing list