PYTHON-5543 PyMongoBaseProtocol should inherit from asyncio.BaseProtocol (#2528)

Co-authored-by: Noah Stapp <noah@noahstapp.com>
This commit is contained in:
Jeffrey A. Clark 2025-09-11 16:37:22 -04:00 committed by GitHub
parent 2b148867e7
commit 3da6e858d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,14 @@
Changelog
=========
Changes in Version 4.15.1 (XXXX/XX/XX)
--------------------------------------
Version 4.15.1 is a bug fix release.
- Fixed a bug in ``AsyncMongoClient`` that caused a
``ServerSelectionTimeoutError`` when used with ``uvicorn``, ``FastAPI``, or ``uvloop``.
Changes in Version 4.15.0 (2025/09/10)
--------------------------------------

View File

@ -22,7 +22,7 @@ import socket
import struct
import sys
import time
from asyncio import BaseTransport, BufferedProtocol, Future, Protocol, Transport
from asyncio import BaseProtocol, BaseTransport, BufferedProtocol, Future, Transport
from typing import (
TYPE_CHECKING,
Any,
@ -250,7 +250,7 @@ class NetworkingInterface(NetworkingInterfaceBase):
return self.conn.recv_into(buffer)
class PyMongoBaseProtocol(Protocol):
class PyMongoBaseProtocol(BaseProtocol):
def __init__(self, timeout: Optional[float] = None):
self.transport: Transport = None # type: ignore[assignment]
self._timeout = timeout