[Tutor] problem with unpickling an object

Yi Qiang yi at yiqiang.net
Mon Jun 5 22:33:18 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yi Qiang wrote, On 06/05/2006 01:22 PM:
> Kent Johnson wrote, On 06/05/2006 07:25 AM:
>>> No, the find_global() hook is for cPickle. See the next-to-last 
>>> paragraph on this page:
>>> http://docs.python.org/lib/pickle-sub.html
> Sorry, I don't follow.  How does one get access to the find_global
> attribute for cPickle?  I created an cPickle.Unpickler object, and the
> only attributes that I have access to are .load and .noload.  What am I
> missing here?
Ok, it looks I have to create that attribute.  Now, the next confusing
part is that the documentation says: 'If it [find_global] is None then
any attempts to unpickle instances will raise an UnpicklingError.'  What
exactly is considered an instance in this context?  I tried unpickling a
dictionary, and it unpickled just fine.  Please, someone explain :)
- --
Yi Qiang (yi at yiqiang.net)
Web: http://www.yiqiang.net
Tel: (206) 661-8469
PGP: 0xB515564B
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEhJUOtXlIMrUVVksRAm8lAJwI1IKZlwiXDRVC+1c73c+ieOmYewCghceY
F8Pqth3M/1ufF3hdkPufHv0=
=Uavt
-----END PGP SIGNATURE-----


More information about the Tutor mailing list