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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8, 3.0
    • Component/s: None
    • Labels:
      None
    • Sprint:
      Python Sprint 8

      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

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: