Cannot pickle bson.ObjectId

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 1.10.1
    • Affects Version/s: 1.10
    • Component/s: None
    • None
    • Environment:
      Ubuntu 64 bit 10.10 Python 2.6
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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 Hackett
              Reporter:
              Roger Binns
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: