Skip to content

Commit 10de931

Browse files
PYTHON-5543 PyMongoBaseProtocol should inherit from asyncio.BaseProtocol (mongodb#2528)
Co-authored-by: Noah Stapp <[email protected]>
1 parent ebe8bfb commit 10de931

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

doc/changelog.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Version 4.15.1 is a bug fix release.
1010
that would cause a ``TypeError`` when using ``pymongocrypt<1.16`` by passing an unsupported ``type_opts`` parameter even if
1111
Queryable Encryption text queries beta was not used.
1212

13+
- Fixed a bug in ``AsyncMongoClient`` that caused a
14+
``ServerSelectionTimeoutError`` when used with ``uvicorn``, ``FastAPI``, or ``uvloop``.
15+
1316
Issues Resolved
1417
...............
1518

@@ -18,7 +21,6 @@ in this release.
1821

1922
.. _PyMongo 4.15.1 release notes in JIRA: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=46486
2023

21-
2224
Changes in Version 4.15.0 (2025/09/10)
2325
--------------------------------------
2426

pymongo/network_layer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import struct
2323
import sys
2424
import time
25-
from asyncio import BaseTransport, BufferedProtocol, Future, Protocol, Transport
25+
from asyncio import BaseProtocol, BaseTransport, BufferedProtocol, Future, Transport
2626
from typing import (
2727
TYPE_CHECKING,
2828
Any,
@@ -250,7 +250,7 @@ def recv_into(self, buffer: bytes) -> int:
250250
return self.conn.recv_into(buffer)
251251

252252

253-
class PyMongoBaseProtocol(Protocol):
253+
class PyMongoBaseProtocol(BaseProtocol):
254254
def __init__(self, timeout: Optional[float] = None):
255255
self.transport: Transport = None # type: ignore[assignment]
256256
self._timeout = timeout

0 commit comments

Comments
 (0)