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

Pickled ObjectIds are not compatible between pymongo 1.9 and 1.10

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 1.10
    • 1.10.1
    • None
    • None
    • Ubuntu linux 10.10
    • Major Change

    Description

      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_.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: