-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.10
-
Component/s: None
-
None
-
Environment:Ubuntu linux 10.10
-
Major Change
In pymongo 1.9, pickled instances of ObjectId assumed that _setitem_ was going to be called with a dict that looked like this:
{'_ObjectId__id': "binary_objectid_string"}pickling in pymongo 1.10 changed such that the surrounding dict is not present, and that the value argument to _setitem_ is just the binary objectid value. This is a more efficient encoding, and is somewhat desirable, but the code needs to be made backward compatible with existing pickled ObjectId instances.
See https://github.com/mongodb/mongo-python-driver/pull/29 for one possible implementation.
The other possibility is to make pymongo 1.10's pickling output the same format as it was in 1.9. It's less efficient in space, but more compatible, and avoids having to do a compatibility check in _setitem_.