Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3fa10c9

Browse files
blink1073mongodb-dbx-release-bot[bot]
authored andcommitted
PYTHON-5540 Fix usage of text_opts for older versions of pymongocrypt (#2525)
(cherry picked from commit 2b14886)
1 parent e2107c2 commit 3fa10c9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎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/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)

AltStyle によって変換されたページ (->オリジナル) /