Skip to content

Commit 7eafd5d

Browse files
committed
Merge branch 'master' of github.com:mongodb/mongo-python-driver
2 parents cf909aa + 351196b commit 7eafd5d

32 files changed

+157
-310
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The PyMongo distribution contains tools for interacting with MongoDB
1111
database from Python. The `bson` package is an implementation of the
1212
[BSON format](http://bsonspec.org) for Python. The `pymongo` package is
1313
a native Python driver for MongoDB. The `gridfs` package is a
14-
[gridfs](https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst/)
14+
[gridfs](https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.md/)
1515
implementation on top of `pymongo`.
1616

1717
PyMongo supports MongoDB 4.0, 4.2, 4.4, 5.0, 6.0, 7.0, and 8.0.

bson/json_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
when :const:`CANONICAL_JSON_OPTIONS` or :const:`LEGACY_JSON_OPTIONS` is
2323
provided, respectively.
2424
25-
.. _Extended JSON: https://github.com/mongodb/specifications/blob/master/source/extended-json.rst
25+
.. _Extended JSON: https://github.com/mongodb/specifications/blob/master/source/extended-json/extended-json.md
2626
2727
Example usage (deserialization):
2828

doc/api/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interacting with MongoDB. :mod:`bson` is an implementation of the
66
`BSON format <http://bsonspec.org>`_, :mod:`pymongo` is a
77
full-featured driver for MongoDB, and :mod:`gridfs` is a set of tools
88
for working with the `GridFS
9-
<https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst/>`_ storage
9+
<https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.md/>`_ storage
1010
specification.
1111

1212
.. toctree::

doc/changelog.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PyMongo 4.11 brings a number of changes including:
1212

1313
- Dropped support for Python 3.8.
1414
- Dropped support for MongoDB 3.6.
15+
- Dropped support for the MONGODB-CR authenticate mechanism, which is no longer supported by MongoDB 4.0+.
1516
- Added support for free-threaded Python with the GIL disabled. For more information see:
1617
`Free-threaded CPython <https://docs.python.org/3.13/whatsnew/3.13.html#whatsnew313-free-threaded-cpython>`_.
1718
- :attr:`~pymongo.asynchronous.mongo_client.AsyncMongoClient.address` and
@@ -23,6 +24,10 @@ PyMongo 4.11 brings a number of changes including:
2324
:meth:`~pymongo.collection.Collection.update_one`, :meth:`~pymongo.collection.Collection.replace_one`,
2425
:class:`~pymongo.operations.UpdateOne`, and
2526
:class:`~pymongo.operations.UpdateMany`,
27+
- :meth:`~pymongo.mongo_client.MongoClient.bulk_write` and
28+
:meth:`~pymongo.asynchronous.mongo_client.AsyncMongoClient.bulk_write` now throw an error
29+
when ``ordered=True`` or ``verboseResults=True`` are used with unacknowledged writes.
30+
These are unavoidable breaking changes.
2631

2732
Issues Resolved
2833
...............
@@ -1022,7 +1027,7 @@ See the `PyMongo 4.0 release notes in JIRA`_ for the list of resolved issues
10221027
in this release.
10231028

10241029
.. _PyMongo 4.0 release notes in JIRA: https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=18463
1025-
.. _DBRef specification: https://github.com/mongodb/specifications/blob/5a8c8d7/source/dbref.rst
1030+
.. _DBRef specification: https://github.com/mongodb/specifications/blob/master/source/dbref/dbref.md
10261031

10271032
Changes in Version 3.13.0 (2022/11/01)
10281033
--------------------------------------
@@ -1557,7 +1562,7 @@ Unavoidable breaking changes:
15571562
bumped to 1.16.0. This is a breaking change for applications that use
15581563
PyMongo's SRV support with a version of ``dnspython`` older than 1.16.0.
15591564

1560-
.. _URI options specification: https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst
1565+
.. _URI options specification: https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.md
15611566

15621567

15631568
Issues Resolved
@@ -1581,7 +1586,7 @@ Changes in Version 3.8.0 (2019/04/22)
15811586
must upgrade to PyPy3.5+.
15821587

15831588
- :class:`~bson.objectid.ObjectId` now implements the `ObjectID specification
1584-
version 0.2 <https://github.com/mongodb/specifications/blob/master/source/objectid.rst>`_.
1589+
version 0.2 <https://github.com/mongodb/specifications/blob/master/source/bson-objectid/objectid.md>`_.
15851590
- For better performance and to better follow the GridFS spec,
15861591
:class:`~gridfs.grid_file.GridOut` now uses a single cursor to read all the
15871592
chunks in the file. Previously, each chunk in the file was queried
@@ -1943,7 +1948,7 @@ Highlights include:
19431948
:class:`~pymongo.operations.UpdateOne`, and
19441949
:class:`~pymongo.operations.UpdateMany`.
19451950
- Implemented the `MongoDB Extended JSON
1946-
<https://github.com/mongodb/specifications/blob/master/source/extended-json.rst>`_
1951+
<https://github.com/mongodb/specifications/blob/master/source/extended-json/extended-json.md>`_
19471952
specification.
19481953
- :class:`~bson.decimal128.Decimal128` now works when cdecimal is installed.
19491954
- PyMongo is now tested against a wider array of operating systems and CPU

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
# wiki.centos.org has been flakey.
8686
# sourceforge.net is giving a 403 error, but is still accessible from the browser.
8787
linkcheck_ignore = [
88-
"https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-monitoring.rst#requesting-an-immediate-check",
88+
"https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-monitoring.md#requesting-an-immediate-check",
8989
"https://github.com/mongodb/libmongocrypt/blob/master/bindings/python/README.rst#installing-from-source",
9090
r"https://wiki.centos.org/[\w/]*",
9191
r"http://sourceforge.net/",

doc/developer/periodic_executor.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Thus the current design of periodic executors is surprisingly simple: they
106106
do a simple ``time.sleep`` for a half-second, check if it is time to wake or
107107
terminate, and sleep again.
108108

109-
.. _Server Discovery And Monitoring Spec: https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-monitoring.rst#requesting-an-immediate-check
109+
.. _Server Discovery And Monitoring Spec: https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-monitoring.md#requesting-an-immediate-check
110110

111111
.. _PYTHON-863: https://jira.mongodb.org/browse/PYTHON-863
112112

doc/examples/authentication.rst

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,6 @@ For best performance on Python versions older than 2.7.8 install `backports.pbkd
7676

7777
.. _backports.pbkdf2: https://pypi.python.org/pypi/backports.pbkdf2/
7878

79-
MONGODB-CR
80-
----------
81-
82-
.. warning:: MONGODB-CR was deprecated with the release of MongoDB 3.6 and
83-
is no longer supported by MongoDB 4.0.
84-
85-
Before MongoDB 3.0 the default authentication mechanism was MONGODB-CR,
86-
the "MongoDB Challenge-Response" protocol::
87-
88-
>>> from pymongo import MongoClient
89-
>>> client = MongoClient('example.com',
90-
... username='user',
91-
... password='password',
92-
... authMechanism='MONGODB-CR')
93-
>>>
94-
>>> uri = "mongodb://user:[email protected]/?authSource=the_database&authMechanism=MONGODB-CR"
95-
>>> client = MongoClient(uri)
96-
9779
Default Authentication Mechanism
9880
--------------------------------
9981

@@ -221,8 +203,7 @@ SASL PLAIN (RFC 4616)
221203

222204
MongoDB Enterprise Edition version 2.6 and newer support the SASL PLAIN
223205
authentication mechanism, initially intended for delegating authentication
224-
to an LDAP server. Using the PLAIN mechanism is very similar to MONGODB-CR.
225-
These examples use the $external virtual database for LDAP support::
206+
to an LDAP server. These examples use the $external virtual database for LDAP support::
226207

227208
>>> from pymongo import MongoClient
228209
>>> uri = "mongodb://user:[email protected]/?authMechanism=PLAIN"

doc/examples/uuid.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Finally, the same UUID would historically be serialized by the Java driver as::
8484
.. note:: For in-depth information about the the byte-order historically
8585
used by different drivers, see the `Handling of Native UUID Types
8686
Specification
87-
<https://github.com/mongodb/specifications/blob/master/source/uuid.rst>`_.
87+
<https://github.com/mongodb/specifications/blob/master/source/bson-binary-uuid/uuid.md>`_.
8888

8989
This difference in the byte-order of UUIDs encoded by different drivers can
9090
result in highly unintuitive behavior in some scenarios. We detail two such

doc/migrate-to-pymongo4.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Renamed URI options
118118

119119
Several deprecated URI options have been renamed to the standardized
120120
option names defined in the
121-
`URI options specification <https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.rst>`_.
121+
`URI options specification <https://github.com/mongodb/specifications/blob/master/source/uri-options/uri-options.md>`_.
122122
The old option names and their renamed equivalents are summarized in the table
123123
below. Some renamed options have different semantics from the option being
124124
replaced as noted in the 'Migration Notes' column.
@@ -965,7 +965,7 @@ correct type. Otherwise the document is returned as normal. Previously, any
965965
subdocument containing a ``$ref`` field would be decoded as a
966966
:class:`~bson.dbref.DBRef`.
967967

968-
.. _DBRef specification: https://github.com/mongodb/specifications/blob/5a8c8d7/source/dbref.rst
968+
.. _DBRef specification: https://github.com/mongodb/specifications/blob/master/source/dbref/dbref.md
969969

970970
Encoding a UUID raises an error by default
971971
..........................................

pymongo/asynchronous/auth.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -329,21 +329,6 @@ async def _authenticate_x509(credentials: MongoCredential, conn: AsyncConnection
329329
await conn.command("$external", cmd)
330330

331331

332-
async def _authenticate_mongo_cr(credentials: MongoCredential, conn: AsyncConnection) -> None:
333-
"""Authenticate using MONGODB-CR."""
334-
source = credentials.source
335-
username = credentials.username
336-
password = credentials.password
337-
# Get a nonce
338-
response = await conn.command(source, {"getnonce": 1})
339-
nonce = response["nonce"]
340-
key = _auth_key(nonce, username, password)
341-
342-
# Actually authenticate
343-
query = {"authenticate": 1, "user": username, "nonce": nonce, "key": key}
344-
await conn.command(source, query)
345-
346-
347332
async def _authenticate_default(credentials: MongoCredential, conn: AsyncConnection) -> None:
348333
if conn.max_wire_version >= 7:
349334
if conn.negotiated_mechs:
@@ -365,7 +350,6 @@ async def _authenticate_default(credentials: MongoCredential, conn: AsyncConnect
365350

366351
_AUTH_MAP: Mapping[str, Callable[..., Coroutine[Any, Any, None]]] = {
367352
"GSSAPI": _authenticate_gssapi,
368-
"MONGODB-CR": _authenticate_mongo_cr,
369353
"MONGODB-X509": _authenticate_x509,
370354
"MONGODB-AWS": _authenticate_aws,
371355
"MONGODB-OIDC": _authenticate_oidc, # type:ignore[dict-item]

0 commit comments

Comments
 (0)