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

BSON C module directly accesses private attributes.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.8
    • 3.9
    • BSON
    • None
    • Any
    • Fully Compatible

    Description

      In cbsonmodule.c under the case 7 (ObjectID) switch, a call is made to PyObject_GetAttrString(value, "_ObjectIdid") instead of PyBytes_AsString requesting Python cast the ObjectId value to a byte string. Interestingly, it does use PyBytes immediately after retrieval of the private attribute. By utilizing that private (mangled) attribute, it requires extremely ugly hacks in any datatype one attempts to write that must be compatible. Please consider implementing bytes within ObjectId (it's curiously missing despite str_ being present!) and utilizing the standard, less-private interface. Thanks!

      Attachments

        Issue Links

          Activity

            People

              shane.harvey@mongodb.com Shane Harvey
              amcgregor Dissatisfied Former User
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: