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

Cannot pickle bson.ObjectId

    • 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 64 bit 10.10 Python 2.6

      In order to save an ObjectId to disk or to pass it between processes it is best if it can be pickled. (Having to insert code all over the place to turn it into a string and back into ObjectId is a pain.)

      >>> pickle.dumps(bson.ObjectId("112233445566"))
      TypeError: a class that defines _slots_ without defining _getstate_ cannot be pickled

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            rogerbinns Roger Binns
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: