Skip to content

Commit a291fd0

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver
2 parents ca59c31 + 3da6e85 commit a291fd0

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

doc/changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Changelog
22
=========
33

4+
Changes in Version 4.15.1 (XXXX/XX/XX)
5+
--------------------------------------
6+
7+
Version 4.15.1 is a bug fix release.
8+
9+
- Fixed a bug in ``AsyncMongoClient`` that caused a
10+
``ServerSelectionTimeoutError`` when used with ``uvicorn``, ``FastAPI``, or ``uvloop``.
11+
412
Changes in Version 4.15.0 (2025/09/10)
513
--------------------------------------
614

pymongo/asynchronous/encryption.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,8 @@ async def _encrypt_helper(
935935
contention_factor=contention_factor,
936936
range_opts=range_opts_bytes,
937937
is_expression=is_expression,
938-
text_opts=text_opts_bytes,
938+
# For compatibility with pymongocrypt < 1.16:
939+
**{"text_opts": text_opts_bytes} if text_opts_bytes else {},
939940
)
940941
return decode(encrypted_doc)["v"]
941942

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 | memoryview) -> 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

pymongo/synchronous/encryption.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,8 @@ def _encrypt_helper(
928928
contention_factor=contention_factor,
929929
range_opts=range_opts_bytes,
930930
is_expression=is_expression,
931-
text_opts=text_opts_bytes,
931+
# For compatibility with pymongocrypt < 1.16:
932+
**{"text_opts": text_opts_bytes} if text_opts_bytes else {},
932933
)
933934
return decode(encrypted_doc)["v"]
934935

0 commit comments

Comments
 (0)