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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.8, 3.0
    • Affects Version/s: None
    • Component/s: None
    • None

      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

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

              Created:
              Updated:
              Resolved: