WriteConcern repr is not eval-able

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • 4.13
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Python Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      WriteConcern repr is not eval-able because it does not quote the w field:

      >>> wc = WriteConcern(w="majority")
      >>> wc
      WriteConcern(w=majority)
      >>> eval(repr(wc))
      Traceback (most recent call last):
        File "<python-input-4>", line 1, in <module>
          eval(repr(wc))
          ~~~~^^^^^^^^^^
        File "<string>", line 1, in <module>
      NameError: name 'majority' is not defined
      

            Assignee:
            Shane Harvey
            Reporter:
            Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: