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

BSON Errors with invalid utf8 strings.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1
    • Affects Version/s: 2.7.1
    • Component/s: None
    • Environment:
      CentOS 6.1, AWS

      This occurs in a python script when a cursor comes in contact with a document that contains an invalid utf8 string.

      The document does indeed contain an invalid utf8 string. The python driver essentially reads this and crashes the cursor with a fatal error:

      bson.errors.InvalidBSON: 'utf8' codec can't decode byte 0xfd in position 1: invalid start byte

      I was able to find the affected document and load it in the mongo shell with no errors.

      I propose that the python driver if able should handle this in a similar fashion, construct the bson document as best it can, throw a warning if necessary but most important; continue iterating through the cursor.

            Assignee:
            anna.herlihy@mongodb.com Anna Herlihy (Inactive)
            Reporter:
            dkatz@we-care.com David Katz
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: