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

MongoClient() doesn't parse arguments properly when None is passed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 2.8, 3.0
    • None
    • None

    Description

      Let's take an example.

      If I am instantiating a MongoClient() with socketTimeoutMS=None, pymongo will raise an exception because mongo_client.py expect an Integer for socketTimeoutMS. In fact, MongoClient() only reverts to the default value when the argument is missing (doing things like if not in **kwargs).
      To follow on that example, I would expect a MongoClient() with socketTimeoutMS=None to have no timeout for access to the socket.

      Many options suffer from that.

      This is largely cosmetic but leads to some complications with a few edge cases (buliding a configuration file for example). This is nothing crazy but in the current state, the docstring of MongoClient() doesn't match the actual behavior. We need to correct the docstring or the code.

      This is the first time I am reporting with jira. Please don't slap me in the face if I am not doing it properly

      Attachments

        Activity

          People

            bernie@mongodb.com Bernie Hackett
            mmalter Michaƫl Malter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: