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

formatting bug in exception message

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      pymongo-1.8.1-py2.6-linux-x86_64

      pymongo/helpers.py
           57     elif not isinstance(index_list, list):
           58         raise TypeError("must use a list of (key, direction) pairs, "
           59                         "not: %r" % index_list)
      

      If index_list is itself a tuple, which can happen if I forgot to put the sort pairs in a list, this string interpolation fails, and I don't get the intended error message.

      Line 59 should be :
      "not: %r" % (index_list,))

            Assignee:
            mike Michael Dirolf
            Reporter:
            drewp Drew Perttula
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: