Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ PyMongo 4.16 brings a number of changes including:
- Fixed return type annotation for ``find_one_and_*`` methods on :class:`~pymongo.asynchronous.collection.AsyncCollection`
and :class:`~pymongo.synchronous.collection.Collection` to include ``None``.
- Added support for NumPy 1D-arrays in :class:`bson.binary.BinaryVector`.
- Prevented :class:`~pymongo.encryption.ClientEncryption` from loading the crypt
shared library to fix "MongoCryptError: An existing crypt_shared library is
loaded by the application" unless the linked library search path is set.

Changes in Version 4.15.5 (2025/XX/XX)
--------------------------------------
Expand Down
8 changes: 7 additions & 1 deletion pymongo/asynchronous/encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

"""Support for explicit client-side field level encryption."""

from __future__ import annotations

import asyncio
Expand Down Expand Up @@ -714,10 +715,15 @@ def __init__(
self._io_callbacks: Optional[_EncryptionIO] = _EncryptionIO(
None, key_vault_coll, None, opts
)

# Pass bypass_encryption=True to skip loading crypt_shared.
self._encryption = AsyncExplicitEncrypter(
self._io_callbacks,
_create_mongocrypt_options(
kms_providers=kms_providers, schema_map=None, key_expiration_ms=key_expiration_ms
kms_providers=kms_providers,
schema_map=None,
key_expiration_ms=key_expiration_ms,
bypass_encryption=True, # Don't load crypt_shared
),
)
# Use the same key vault collection as the callback.
Expand Down
8 changes: 7 additions & 1 deletion pymongo/synchronous/encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

"""Support for explicit client-side field level encryption."""

from __future__ import annotations

import contextlib
Expand Down Expand Up @@ -707,10 +708,15 @@ def __init__(
self._io_callbacks: Optional[_EncryptionIO] = _EncryptionIO(
None, key_vault_coll, None, opts
)

# Pass bypass_encryption=True to skip loading crypt_shared.
self._encryption = ExplicitEncrypter(
self._io_callbacks,
_create_mongocrypt_options(
kms_providers=kms_providers, schema_map=None, key_expiration_ms=key_expiration_ms
kms_providers=kms_providers,
schema_map=None,
key_expiration_ms=key_expiration_ms,
bypass_encryption=True, # Don't load crypt_shared
),
)
# Use the same key vault collection as the callback.
Expand Down
Loading