Skip to content

MOTOR-1479 & MOTOR-1480 Fix build failures from PyMongo 4.17 changes#386

Merged
blink1073 merged 3 commits into
mongodb:masterfrom
blink1073:MOTOR-1479
Jun 3, 2026
Merged

MOTOR-1479 & MOTOR-1480 Fix build failures from PyMongo 4.17 changes#386
blink1073 merged 3 commits into
mongodb:masterfrom
blink1073:MOTOR-1479

Conversation

@blink1073

Copy link
Copy Markdown
Member

Summary

Fixes build failures introduced by PyMongo 4.17:

  • MOTOR-1479: PyMongo 4.17 (PYTHON-4542) added a bind() method to ClientSession. Motor is in maintenance mode and not adding new features, so bind is 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.py to PyMongo's test suite, which imports pymongo.daemon. The synchro test runner replaces the pymongo namespace with synchro, so import pymongo.daemon fails unless daemon is re-exported from synchro/__init__.py.

Additional fixes for failures exposed on PyMongo 4.17:

  • Typing: Guard time.mktime(date_tuple) in motor/web.py against None, which email.utils.parsedate can return for malformed If-Modified-Since headers.

  • Exhaust cursor tests: Skip MotorClientExhaustCursorTest — mockupdb's OpMsg support is insufficient for the current PyMongo wire protocol.

  • Linkcheck: Fix broken external links (#cursor-batches and #std-label-pymongo-mongodb-aws anchors). Set linkcheck_workers = 1 and linkcheck_timeout = 60 per PYTHON-5847 to prevent the dochub redirect service from dropping connections under concurrent load.

@blink1073 blink1073 requested a review from a team as a code owner June 1, 2026 19:56
@blink1073 blink1073 requested a review from NoahStapp June 1, 2026 19:56
@blink1073 blink1073 changed the title MOTOR-1479 MOTOR-1480 Fix build failures from PyMongo 4.17 changes MOTOR-1479 & MOTOR-1480 Fix build failures from PyMongo 4.17 changes Jun 1, 2026
Comment thread motor/web.py
@blink1073

Copy link
Copy Markdown
Member Author

Putting it in draft until evergreen passes

@blink1073 blink1073 marked this pull request as draft June 1, 2026 21:19
@blink1073 blink1073 force-pushed the MOTOR-1479 branch 2 times, most recently from a3eb975 to 72d1148 Compare June 2, 2026 12:33
- 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
blink1073 added 2 commits June 2, 2026 14:00
- 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)
@blink1073 blink1073 marked this pull request as ready for review June 2, 2026 19:51
@blink1073 blink1073 merged commit 0876271 into mongodb:master Jun 3, 2026
44 checks passed
@blink1073 blink1073 deleted the MOTOR-1479 branch June 3, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants