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

Some BSON types are hashable in python 2 but not python 3

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.9, 3.1
    • Affects Version/s: 3.0.3
    • Component/s: None
    • None
    • Environment:
      python 3.4.3

      when loading in documents using the bson.json_util.dumps function, loaded Binary objects are not hashable.

      it is possible to wrap these objects in bytes(), but yet another isinstance check is not something i'd like to add - especially when the same code works without it in python2.

      the docs all say that in py3 Binary objects loaded from the db are converted to native bytes in python3 - can this behavior be replicated for load from json_util.loads ?

            Assignee:
            luke.lovett Luke Lovett
            Reporter:
            underrun Derek Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: