Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-230

Pickled ObjectIds are not compatible between pymongo 1.9 and 1.10

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.10.1
    • Affects Version/s: 1.10
    • Component/s: None
    • Labels:
      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_.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            slacy Steve Lacy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: