-
Type: Bug
-
Resolution: Done
-
Priority: Trivial - P5
-
Affects Version/s: 2.9, 2.9.1
-
Component/s: None
-
None
In PyMongo 2.x, Database.command can call self.connection.disconnect in certain error cases. PyMongo 2.9 deprecated MongoClient.disconnect(), raising DeprecationWarning, in favor of MognoClient.close(). This means that Database.command can sometimes unnecessarily raise DeprecationWarning.
Sadly, we can't just switch to close() because MongoReplicaSetClient.disconnect() has very different behavior from MongoReplicaSetClient.close() (close() shuts down the replica set monitor).