MOTOR-1479 & MOTOR-1480 Fix build failures from PyMongo 4.17 changes#386
Merged
Conversation
NoahStapp
requested changes
Jun 1, 2026
Member
Author
|
Putting it in draft until evergreen passes |
a3eb975 to
72d1148
Compare
- Exclude `bind` from session attribute parity check; it returns a sync context manager that doesn't fit Motor's async session model (PYTHON-4542) - Add `daemon` to synchro's pymongo re-exports so test_daemon.py can import `pymongo.daemon` during synchro test runs (PYTHON-5774) - Replace assert with guard in web.py mktime call for malformed headers - Skip MotorClientExhaustCursorTest; mockupdb OpMsg support needed - Fix broken doc links: cursor-batches anchor, mongodb-aws anchor - Set linkcheck_workers=1 and linkcheck_timeout=60 per PYTHON-5847
- Exclude `bind` from session attribute parity check; it returns a sync context manager that doesn't fit Motor's async session model (PYTHON-4542) - Add `daemon` to synchro's pymongo re-exports so test_daemon.py can import `pymongo.daemon` during synchro test runs (PYTHON-5774) - Replace assert with guard in web.py mktime call for malformed headers - Skip MotorClientExhaustCursorTest; mockupdb OpMsg support needed - Fix broken doc links: cursor-batches anchor, mongodb-aws anchor - Set linkcheck_workers=1 and linkcheck_timeout=60 per PYTHON-5847
- Exclude `bind` from session attribute parity check (PYTHON-4542) - Add `daemon` and `uri_parser_shared` to synchro re-exports (PYTHON-5774) - Guard mktime in web.py against None from malformed If-Modified-Since headers - Skip MotorClientExhaustCursorTest; needs OP_MSG mockupdb support - Fix broken doc links and set linkcheck_workers=1/timeout=60 (PYTHON-5847) - Exclude async test directory and threading tests from synchro suite - Fix synchro skip mechanism: use add_marker instead of addSkip - Exclude TestRetryableReads tests that deadlock via threaded event callbacks - Exclude TestClientSSL.test_use_pyopenssl_when_available (PyMongo 4.17 change)
NoahStapp
approved these changes
Jun 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes build failures introduced by PyMongo 4.17:
MOTOR-1479: PyMongo 4.17 (PYTHON-4542) added a
bind()method toClientSession. Motor is in maintenance mode and not adding new features, sobindis excluded from the session attribute parity check (matching how other PyMongo-only attributes are handled, e.g.pymongo_client_only).MOTOR-1480: PYTHON-5774 added
test_daemon.pyto PyMongo's test suite, which importspymongo.daemon. The synchro test runner replaces thepymongonamespace withsynchro, soimport pymongo.daemonfails unlessdaemonis re-exported fromsynchro/__init__.py.Additional fixes for failures exposed on PyMongo 4.17:
Typing: Guard
time.mktime(date_tuple)inmotor/web.pyagainstNone, whichemail.utils.parsedatecan return for malformedIf-Modified-Sinceheaders.Exhaust cursor tests: Skip
MotorClientExhaustCursorTest— mockupdb'sOpMsgsupport is insufficient for the current PyMongo wire protocol.Linkcheck: Fix broken external links (
#cursor-batchesand#std-label-pymongo-mongodb-awsanchors). Setlinkcheck_workers = 1andlinkcheck_timeout = 60per PYTHON-5847 to prevent the dochub redirect service from dropping connections under concurrent load.