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

Document support for unicode_decode_error_handler argument for MongoClient

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 3.12, 4.0
    • Docs

    Description

      MongoClient supports the unicode_decode_error_handler argument:

      >>> client = MongoClient()
      >>> client.codec_options.unicode_decode_error_handler
      'strict'
      >>> client = MongoClient(unicode_decode_error_handler='replace')
      >>> client.codec_options.unicode_decode_error_handler
      'replace'
      >>> client = MongoClient(unicode_decode_error_handler='ignore')
      >>> client.codec_options.unicode_decode_error_handler
      'ignore'
      

      It is also supported in the URI:

      >>> client = MongoClient('mongodb://localhost/?unicode_decode_error_handler=ignore')
      >>> client.codec_options.unicode_decode_error_handler
      'ignore'
      

      We should document this feature.

      Attachments

        Activity

          People

            bernie@mongodb.com Bernie Hackett
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: