[Zope] Zope and pickle oddness
scott kaplan
skaplan@wso.williams.edu
Sat, 8 Jan 2000 05:14:45 -0500 (EST)
Hey all, an odd question,
I have been playing around with the export import functions, (just for fun
:) ) And was trying to pull stuff out of zexp files (not through the
normal way) and I noticed something odd. When i unpickle an object from
a .zexp file, lets say its a simple DTML method I can get two differnet
results
If I have the pickled string lets call it pick_string and i use
pickle.loads(pick_string) or (as the importFile func has it)
pfile=StringIO(pick_string)
unpickler=Unpickler(pfile)
unpickler.load()
These give me an object of type tuple which reads
(('OFS.DTMLMethod','DTMLMethod'),None)
just a tuple od string (pretty useless)
but if I take that same string and put it in a file and use
pickle.load(file)
or
unpickler=Unpickler(file)
unpickler.load()
I get a dictionary object which also reads
(('OFS.DTMLMethod','DTMLMethod'),None)
but has keys (raw,__name__,etc.) all the good stuff I would
expect from a DTML method.
Can anyone tell me whats going on here?
Is this pickle being odd, or just me???
thanks
-scott