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

Invalid read_preference validation using uri_parser

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 3.2.2
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      It look like issue is the same as PYTHON-471 (unfortunately, I don't have permissions to reopen that issue).

      In [25]: parse_uri('mongodb://host1,host2/db?read_preference=secondaryPreferred')
      
      TypeError: 'secondaryPreferred' is not a read preference.
      venv/lib/python3.5/site-packages/pymongo/common.py in validate_read_preference(dummy, value)
          281     """
          282     if not isinstance(value, _ServerMode):
      --> 283         raise TypeError("%r is not a read preference." % (value,))
          284     return value
          285 
      
      TypeError: 'secondaryPreferred' is not a read preference.
      
      

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            fix Sergey NInua
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: