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

Pickled ObjectIds are not compatible between pymongo 1.9 and 1.10

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.10
    • Fix Version/s: 1.10.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Ubuntu linux 10.10
    • Backwards Compatibility:
      Major Change
    • # Replies:
      1
    • Last comment by Customer:
      false

      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

            • Assignee:
              behackett Bernie Hackett
              Reporter:
              slacy Steve Lacy
              Participants:
              Last commenter:
              Rathi Gnanasekaran
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                7 years, 42 weeks, 6 days ago
                Date of 1st Reply: