From a quick read of the docs, it looks like you should set the unpickler's find_global attribute to a function you define. This function can first attempt to load the desired class (see pickle.find_class() for an example). If the load fails, then return a placeholder class that you define.
This won't give exactly the result you ask for, instead of None in the dictionary you will have instances of the placeholder. You could then post-process the dict to change the placeholder instances to None if you like. Kent Yi Qiang wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi list, > I am pickling a dictionary that has as one of it's values an object I > create on the fly. When I try to unpickle that object, cPickle attempts > to recreate that object but of course that module is not present > anymore. How can I just make it skip over that particular key and just > set the value to None? > > Thanks, > - -- > Yi Qiang ([EMAIL PROTECTED]) > Web: http://www.yiqiang.net > Tel: (206) 661-8469 > PGP: 0xB515564B > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2.2 (GNU/Linux) > > iD8DBQFEg8k0tXlIMrUVVksRAt2tAJ4hq/3KmDo6BbS3p3AwhKf4Ga52DQCfXFtx > GERJqs3IcLXuKaRcq/zuRUE= > =SEZ6 > -----END PGP SIGNATURE----- > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > > _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor