[Zope] Re: Saving Pipe3 object

Li Dongfeng mavip5@inet.polyu.edu.hk
Fri, 27 Aug 1999 11:16:06 +0800


Alexander Staubo wrote:

> The underscore prefix should be enough: Your variable can be named
> _long_R_Pipe and it won't be pickled.
>

I have tried this suggestion and the "UnPickleableError" appeared again.

>
> DC uses the _v_ prefix convention for various stuff, possibly meaning
> "value"... Who knows.
>

_v_ means "volatile". See ZOPE ODB3 guide.

>
> --
> Alexander Staubo             http://www.mop.no/~alex/
> "QED?" said Russell.
> "It's Latin," said Morgan. "It means, 'So there you bastard'."
> --Robert Rankin, _Nostramadus Ate My Hamster_
>
> > -----Original Message-----
> > From: Li Dongfeng [mailto:mavip5@inet.polyu.edu.hk]
> > Sent: 26. august 1999 15:13
> > To: ZOPE List
> > Subject: [Zope] Re: Saving Pipe3 object
> >
> >
> > I have solved this problem. Giving an non-persistent attribute
> > a name starting with "_v_" can avoid pickling it. So I used
> >   setattr(self, "_v_long_R_Pipe", long_R)
> > and the attribute can be access outside of the defining method.
> >
> > Li Dongfeng wrote:
> >
> > > I'm using ZOPE to develope a statistics server using R(a GPLed
> > > statistical software). For this, I started the R executable with
> > > popen2.Popen in an external method, but I need to exit the method
> > > without shutting down the pipe, so I used
> > > setattr(self, "some_name", the_pipe) to save the Pipe3 object
> > > as an attribute,
> > > and got an error message: Object unpicklable.
> > >
> > > I understand a open pipe cannot be restored from a file,
> > > but can I save the Pipe3 object reference somewhere
> > > in the running ZOPE's name space without pickling?
> > > Then I can use it in other method to control the
> > > running R process.
> > >
> > > This is a general problem if you want to use Zope
> > > to control other long-running processes.
> >
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://www.zope.org/mailman/listinfo/zope
> >
> > (To receive general Zope announcements, see:
> > http://www.zope.org/mailman/listinfo/zope-announce
> >
> > For developer-specific issues, zope-dev@zope.org -
> > http://www.zope.org/mailman/listinfo/zope-dev )
> >