bsddb.dbshelve problem unpickling objects from another directory

BG nomail
Mon Feb 2 02:00:59 EST 2004


Josiah,

Thank you for your quick answer. But, this very much limits the way
persistent objects can be used. Objects can apparently only be used in the
context they were created. There is a logic to this, but it is also strange
to me. Is there a way that upickled objects can also be used outside there
original context?

Berry.

"Josiah Carlson" <jcarlson at nospam.uci.edu> schreef in bericht
news:bvk2t3$q5h$1 at news.service.uci.edu...
> BG wrote:
>
> > I am experimenting with dbshelve in Python 2.3.3 on Win2k. The problem
is
> > that objects put into the dbshelve by a script in one directory cannot
be
> > unpickled by script running in another directory. Why?
> >
> > I am writing my own collection called testcollection to hold testitems.
The
> > testcollection uses dbshelve to store its items to disk. I want design a
> > package called testmodules.
> [snip]
>
> Pickled objects reference the module and the class from which they were
> created from.
> When running testmodules/test.py, testitem lives in in the module
testitem.
> When running test.py, testitem lives in the module testmodules.testitem.
>
>
>   - Josiah





More information about the Python-list mailing list