Skip to content

Commit 22c09ec

Browse files
committed
Address review
1 parent c64bc2c commit 22c09ec

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

doc/changelog.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ PyMongo 4.16 brings a number of changes including:
1717
- Fixed return type annotation for ``find_one_and_*`` methods on :class:`~pymongo.asynchronous.collection.AsyncCollection`
1818
and :class:`~pymongo.synchronous.collection.Collection` to include ``None``.
1919
- Added support for NumPy 1D-arrays in :class:`bson.binary.BinaryVector`.
20-
- Fixed a bug in :class:`~pymongo.encryption.ClientEncryption`: ClientEncryption
21-
shouldn't try to load mongo crypt shared library.
20+
- Prevented :class:`~pymongo.encryption.ClientEncryption` from loading the crypt
21+
shared library to fix "MongoCryptError: An existing crypt_shared library is
22+
loaded by the application" unless the linked library search path is set.
2223

2324
Changes in Version 4.15.5 (2025/XX/XX)
2425
--------------------------------------

pymongo/asynchronous/encryption.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
"""Support for explicit client-side field level encryption."""
16+
1617
from __future__ import annotations
1718

1819
import asyncio
@@ -719,7 +720,10 @@ def __init__(
719720
self._encryption = AsyncExplicitEncrypter(
720721
self._io_callbacks,
721722
_create_mongocrypt_options(
722-
kms_providers=kms_providers, schema_map=None, key_expiration_ms=key_expiration_ms, bypass_encryption=True
723+
kms_providers=kms_providers,
724+
schema_map=None,
725+
key_expiration_ms=key_expiration_ms,
726+
bypass_encryption=True, # Don't load crypt_shared
723727
),
724728
)
725729
# Use the same key vault collection as the callback.

pymongo/synchronous/encryption.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
"""Support for explicit client-side field level encryption."""
16+
1617
from __future__ import annotations
1718

1819
import contextlib
@@ -715,7 +716,7 @@ def __init__(
715716
kms_providers=kms_providers,
716717
schema_map=None,
717718
key_expiration_ms=key_expiration_ms,
718-
bypass_encryption=True,
719+
bypass_encryption=True, # Don't load crypt_shared
719720
),
720721
)
721722
# Use the same key vault collection as the callback.

0 commit comments

Comments
 (0)