From 63a021c1641562c323b89d284ac3107ca3807c88 Mon Sep 17 00:00:00 2001 From: Sophia Yang Date: Thu, 4 Jun 2026 10:37:52 -0400 Subject: [PATCH 1/2] bump maxWireVersion 29 --- pymongo/common.py | 4 ++-- test/test_topology.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pymongo/common.py b/pymongo/common.py index ea349b3d23..7ab4b64d2c 100644 --- a/pymongo/common.py +++ b/pymongo/common.py @@ -69,8 +69,8 @@ # What this version of PyMongo supports. MIN_SUPPORTED_SERVER_VERSION = "4.2" MIN_SUPPORTED_WIRE_VERSION = 8 -# MongoDB 8.0 -MAX_SUPPORTED_WIRE_VERSION = 25 +# MongoDB 9.0 +MAX_SUPPORTED_WIRE_VERSION = 29 # Frequency to call hello on servers, in seconds. HEARTBEAT_FREQUENCY = 10 diff --git a/test/test_topology.py b/test/test_topology.py index c87c48819e..8738f97d2a 100644 --- a/test/test_topology.py +++ b/test/test_topology.py @@ -594,7 +594,7 @@ def test_wire_version(self): "setName": "rs", "hosts": ["a"], "minWireVersion": 26, - "maxWireVersion": 27, + "maxWireVersion": 29, }, ) From beae88fbfa68ee265669be8d815724f6451b2c2d Mon Sep 17 00:00:00 2001 From: Sophia Yang Date: Thu, 4 Jun 2026 11:09:31 -0400 Subject: [PATCH 2/2] use shared const in test assert --- test/test_topology.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/test_topology.py b/test/test_topology.py index 8738f97d2a..83e269560f 100644 --- a/test/test_topology.py +++ b/test/test_topology.py @@ -593,8 +593,8 @@ def test_wire_version(self): HelloCompat.LEGACY_CMD: True, "setName": "rs", "hosts": ["a"], - "minWireVersion": 26, - "maxWireVersion": 29, + "minWireVersion": common.MAX_SUPPORTED_WIRE_VERSION + 1, + "maxWireVersion": common.MAX_SUPPORTED_WIRE_VERSION + 2, }, ) @@ -604,8 +604,9 @@ def test_wire_version(self): # Error message should say which server failed and why. self.assertEqual( str(e), - "Server at a:27017 requires wire version 26, but this version " - "of PyMongo only supports up to %d." % (common.MAX_SUPPORTED_WIRE_VERSION,), + "Server at a:27017 requires wire version %d, but this version " + "of PyMongo only supports up to %d." + % (common.MAX_SUPPORTED_WIRE_VERSION + 1, common.MAX_SUPPORTED_WIRE_VERSION), ) else: self.fail("No error with incompatible wire version")