Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-pymongo for openSUSE:Factory 
checked in at 2021-04-26 16:38:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pymongo (Old)
 and      /work/SRC/openSUSE:Factory/.python-pymongo.new.12324 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pymongo"

Mon Apr 26 16:38:46 2021 rev:38 rq:887877 version:3.11.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pymongo/python-pymongo.changes    
2021-02-04 20:23:52.598808216 +0100
+++ /work/SRC/openSUSE:Factory/.python-pymongo.new.12324/python-pymongo.changes 
2021-04-26 16:38:58.294013292 +0200
@@ -1,0 +2,7 @@
+Thu Apr 22 19:55:18 UTC 2021 - Dirk M??ller <dmuel...@suse.com>
+
+- update to 3.11.3:
+  - Version 3.11.3 fixes a bug that prevented PyMongo from retrying writes
+    after a writeConcernError on MongoDB 4.4+ (PYTHON-2452)
+
+-------------------------------------------------------------------

Old:
----
  pymongo-3.11.2.tar.gz

New:
----
  pymongo-3.11.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pymongo.spec ++++++
--- /var/tmp/diff_new_pack.RDbLA4/_old  2021-04-26 16:38:58.762014037 +0200
+++ /var/tmp/diff_new_pack.RDbLA4/_new  2021-04-26 16:38:58.766014044 +0200
@@ -18,12 +18,12 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-pymongo
-Version:        3.11.2
+Version:        3.11.3
 Release:        0
 Summary:        Python driver for MongoDB
 License:        Apache-2.0
 Group:          Development/Languages/Python
-URL:            http://github.com/mongodb/mongo-python-driver
+URL:            https://github.com/mongodb/mongo-python-driver
 Source:         
https://files.pythonhosted.org/packages/source/p/pymongo/pymongo-%{version}.tar.gz
 # PATCH-FIX-SUSE: upstream does not care about 32bit
 Patch0:         mongodb-skip-test.patch

++++++ pymongo-3.11.2.tar.gz -> pymongo-3.11.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.2/PKG-INFO new/pymongo-3.11.3/PKG-INFO
--- old/pymongo-3.11.2/PKG-INFO 2020-12-03 00:30:21.000000000 +0100
+++ new/pymongo-3.11.3/PKG-INFO 2021-02-03 03:56:53.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pymongo
-Version: 3.11.2
+Version: 3.11.3
 Summary: Python driver for MongoDB <http://www.mongodb.org>
 Home-page: http://github.com/mongodb/mongo-python-driver
 Author: Mike Dirolf
@@ -258,11 +258,11 @@
 Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Database
 Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
-Provides-Extra: ocsp
-Provides-Extra: aws
-Provides-Extra: srv
-Provides-Extra: snappy
-Provides-Extra: encryption
 Provides-Extra: tls
+Provides-Extra: encryption
+Provides-Extra: aws
 Provides-Extra: gssapi
+Provides-Extra: snappy
+Provides-Extra: srv
 Provides-Extra: zstd
+Provides-Extra: ocsp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.2/doc/api/pymongo/collection.rst 
new/pymongo-3.11.3/doc/api/pymongo/collection.rst
--- old/pymongo-3.11.2/doc/api/pymongo/collection.rst   2020-12-03 
00:29:58.000000000 +0100
+++ new/pymongo-3.11.3/doc/api/pymongo/collection.rst   2021-02-03 
01:53:34.000000000 +0100
@@ -47,8 +47,8 @@
       .. automethod:: aggregate
       .. automethod:: aggregate_raw_batches
       .. automethod:: watch
-      .. automethod:: find(filter=None, projection=None, skip=0, limit=0, 
no_cursor_timeout=False, cursor_type=CursorType.NON_TAILABLE, sort=None, 
allow_partial_results=False, oplog_replay=False, modifiers=None, batch_size=0, 
manipulate=True, collation=None, hint=None, max_scan=None, max_time_ms=None, 
max=None, min=None, return_key=False, show_record_id=False, snapshot=False, 
comment=None, session=None)
-      .. automethod:: find_raw_batches(filter=None, projection=None, skip=0, 
limit=0, no_cursor_timeout=False, cursor_type=CursorType.NON_TAILABLE, 
sort=None, allow_partial_results=False, oplog_replay=False, modifiers=None, 
batch_size=0, manipulate=True, collation=None, hint=None, max_scan=None, 
max_time_ms=None, max=None, min=None, return_key=False, show_record_id=False, 
snapshot=False, comment=None)
+      .. automethod:: find(filter=None, projection=None, skip=0, limit=0, 
no_cursor_timeout=False, cursor_type=CursorType.NON_TAILABLE, sort=None, 
allow_partial_results=False, oplog_replay=False, modifiers=None, batch_size=0, 
manipulate=True, collation=None, hint=None, max_scan=None, max_time_ms=None, 
max=None, min=None, return_key=False, show_record_id=False, snapshot=False, 
comment=None, session=None, allow_disk_use=None)
+      .. automethod:: find_raw_batches(filter=None, projection=None, skip=0, 
limit=0, no_cursor_timeout=False, cursor_type=CursorType.NON_TAILABLE, 
sort=None, allow_partial_results=False, oplog_replay=False, modifiers=None, 
batch_size=0, manipulate=True, collation=None, hint=None, max_scan=None, 
max_time_ms=None, max=None, min=None, return_key=False, show_record_id=False, 
snapshot=False, comment=None, allow_disk_use=None)
       .. automethod:: find_one(filter=None, *args, **kwargs)
       .. automethod:: find_one_and_delete
       .. automethod:: find_one_and_replace(filter, replacement, 
projection=None, sort=None, return_document=ReturnDocument.BEFORE, hint=None, 
session=None, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.2/doc/api/pymongo/cursor.rst 
new/pymongo-3.11.3/doc/api/pymongo/cursor.rst
--- old/pymongo-3.11.2/doc/api/pymongo/cursor.rst       2020-12-03 
00:29:58.000000000 +0100
+++ new/pymongo-3.11.3/doc/api/pymongo/cursor.rst       2021-02-03 
01:53:34.000000000 +0100
@@ -15,7 +15,7 @@
       .. autoattribute:: EXHAUST
          :annotation:
 
-   .. autoclass:: pymongo.cursor.Cursor(collection, filter=None, 
projection=None, skip=0, limit=0, no_cursor_timeout=False, 
cursor_type=CursorType.NON_TAILABLE, sort=None, allow_partial_results=False, 
oplog_replay=False, modifiers=None, batch_size=0, manipulate=True, 
collation=None, hint=None, max_scan=None, max_time_ms=None, max=None, min=None, 
return_key=False, show_record_id=False, snapshot=False, comment=None)
+   .. autoclass:: pymongo.cursor.Cursor(collection, filter=None, 
projection=None, skip=0, limit=0, no_cursor_timeout=False, 
cursor_type=CursorType.NON_TAILABLE, sort=None, allow_partial_results=False, 
oplog_replay=False, modifiers=None, batch_size=0, manipulate=True, 
collation=None, hint=None, max_scan=None, max_time_ms=None, max=None, min=None, 
return_key=False, show_record_id=False, snapshot=False, comment=None, 
session=None, allow_disk_use=None)
       :members:
 
       .. describe:: c[index]
@@ -24,4 +24,4 @@
 
       .. automethod:: __getitem__
 
-   .. autoclass:: pymongo.cursor.RawBatchCursor(collection, filter=None, 
projection=None, skip=0, limit=0, no_cursor_timeout=False, 
cursor_type=CursorType.NON_TAILABLE, sort=None, allow_partial_results=False, 
oplog_replay=False, modifiers=None, batch_size=0, collation=None, hint=None, 
max_scan=None, max_time_ms=None, max=None, min=None, return_key=False, 
show_record_id=False, snapshot=False, comment=None)
+   .. autoclass:: pymongo.cursor.RawBatchCursor(collection, filter=None, 
projection=None, skip=0, limit=0, no_cursor_timeout=False, 
cursor_type=CursorType.NON_TAILABLE, sort=None, allow_partial_results=False, 
oplog_replay=False, modifiers=None, batch_size=0, collation=None, hint=None, 
max_scan=None, max_time_ms=None, max=None, min=None, return_key=False, 
show_record_id=False, snapshot=False, comment=None, allow_disk_use=None)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.2/doc/changelog.rst 
new/pymongo-3.11.3/doc/changelog.rst
--- old/pymongo-3.11.2/doc/changelog.rst        2020-12-03 00:30:07.000000000 
+0100
+++ new/pymongo-3.11.3/doc/changelog.rst        2021-02-03 02:55:08.000000000 
+0100
@@ -1,6 +1,21 @@
 Changelog
 =========
 
+Changes in Version 3.11.3
+-------------------------
+
+Issues Resolved
+...............
+
+Version 3.11.3 fixes a bug that prevented PyMongo from retrying writes after
+a ``writeConcernError`` on MongoDB 4.4+ (`PYTHON-2452`_)
+
+See the `PyMongo 3.11.3 release notes in JIRA`_ for the list of resolved issues
+in this release.
+
+.. _PYTHON-2452: https://jira.mongodb.org/browse/PYTHON-2452
+.. _PyMongo 3.11.3 release notes in JIRA: 
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=30355
+
 Changes in Version 3.11.2
 -------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.2/pymongo/__init__.py 
new/pymongo-3.11.3/pymongo/__init__.py
--- old/pymongo-3.11.2/pymongo/__init__.py      2020-12-03 00:30:07.000000000 
+0100
+++ new/pymongo-3.11.3/pymongo/__init__.py      2021-02-03 02:55:08.000000000 
+0100
@@ -74,7 +74,7 @@
 ALL = 2
 """Profile all operations."""
 
-version_tuple = (3, 11, 2)
+version_tuple = (3, 11, 3)
 
 def get_version_string():
     if isinstance(version_tuple[-1], str):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.2/pymongo/helpers.py 
new/pymongo-3.11.3/pymongo/helpers.py
--- old/pymongo-3.11.2/pymongo/helpers.py       2020-12-03 00:29:58.000000000 
+0100
+++ new/pymongo-3.11.3/pymongo/helpers.py       2021-02-03 01:53:34.000000000 
+0100
@@ -115,7 +115,11 @@
                                max_wire_version)
 
     if parse_write_concern_error and 'writeConcernError' in response:
-        _raise_write_concern_error(response['writeConcernError'])
+        _error = response["writeConcernError"]
+        _labels = response.get("errorLabels")
+        if _labels:
+            _error.update({'errorLabels': _labels})
+        _raise_write_concern_error(_error)
 
     if response["ok"]:
         return
@@ -223,6 +227,9 @@
 
     error = result.get("writeConcernError")
     if error:
+        error_labels = result.get("errorLabels")
+        if error_labels:
+            error.update({'errorLabels': error_labels})
         _raise_write_concern_error(error)
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.2/pymongo.egg-info/PKG-INFO 
new/pymongo-3.11.3/pymongo.egg-info/PKG-INFO
--- old/pymongo-3.11.2/pymongo.egg-info/PKG-INFO        2020-12-03 
00:30:20.000000000 +0100
+++ new/pymongo-3.11.3/pymongo.egg-info/PKG-INFO        2021-02-03 
03:56:52.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pymongo
-Version: 3.11.2
+Version: 3.11.3
 Summary: Python driver for MongoDB <http://www.mongodb.org>
 Home-page: http://github.com/mongodb/mongo-python-driver
 Author: Mike Dirolf
@@ -258,11 +258,11 @@
 Classifier: Programming Language :: Python :: Implementation :: PyPy
 Classifier: Topic :: Database
 Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
-Provides-Extra: ocsp
-Provides-Extra: aws
-Provides-Extra: srv
-Provides-Extra: snappy
-Provides-Extra: encryption
 Provides-Extra: tls
+Provides-Extra: encryption
+Provides-Extra: aws
 Provides-Extra: gssapi
+Provides-Extra: snappy
+Provides-Extra: srv
 Provides-Extra: zstd
+Provides-Extra: ocsp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.2/pymongo.egg-info/requires.txt 
new/pymongo-3.11.3/pymongo.egg-info/requires.txt
--- old/pymongo-3.11.2/pymongo.egg-info/requires.txt    2020-12-03 
00:30:20.000000000 +0100
+++ new/pymongo-3.11.3/pymongo.egg-info/requires.txt    2021-02-03 
03:56:52.000000000 +0100
@@ -17,9 +17,10 @@
 python-snappy
 
 [srv]
-dnspython<2.0.0,>=1.16.0
+dnspython<1.17.0,>=1.16.0
 
 [tls]
+ipaddress
 
 [zstd]
 zstandard
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.2/setup.py new/pymongo-3.11.3/setup.py
--- old/pymongo-3.11.2/setup.py 2020-12-03 00:30:07.000000000 +0100
+++ new/pymongo-3.11.3/setup.py 2021-02-03 02:55:08.000000000 +0100
@@ -39,7 +39,7 @@
     except ImportError:
         _HAVE_SPHINX = False
 
-version = "3.11.2"
+version = "3.11.3"
 
 f = open("README.rst")
 try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.2/test/test_client.py 
new/pymongo-3.11.3/test/test_client.py
--- old/pymongo-3.11.2/test/test_client.py      2020-12-03 00:29:58.000000000 
+0100
+++ new/pymongo-3.11.3/test/test_client.py      2021-02-03 02:55:08.000000000 
+0100
@@ -1645,7 +1645,7 @@
             # If a bug like PYTHON-2433 is reintroduced then too many
             # ServerDescriptions will be kept alive and this test will fail:
             # AssertionError: 4 != 22 within 5 delta (18 difference)
-            self.assertAlmostEqual(initial_count, final_count, delta=5)
+            self.assertAlmostEqual(initial_count, final_count, delta=10)
 
 
 class TestExhaustCursor(IntegrationTest):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.2/test/test_database.py 
new/pymongo-3.11.3/test/test_database.py
--- old/pymongo-3.11.2/test/test_database.py    2020-12-03 00:29:58.000000000 
+0100
+++ new/pymongo-3.11.3/test/test_database.py    2021-02-03 02:55:08.000000000 
+0100
@@ -444,6 +444,8 @@
         self.assertTrue(isinstance(info[0]['op'], string_type))
         self.assertTrue(isinstance(info[0]["ts"], datetime.datetime))
 
+    # SERVER-47817 removes the resetError command.
+    @client_context.require_version_max(4, 9)
     @client_context.require_no_mongos
     @ignore_deprecations
     def test_errors(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.2/test/test_retryable_writes.py 
new/pymongo-3.11.3/test/test_retryable_writes.py
--- old/pymongo-3.11.2/test/test_retryable_writes.py    2020-12-03 
00:29:58.000000000 +0100
+++ new/pymongo-3.11.3/test/test_retryable_writes.py    2021-02-03 
01:53:34.000000000 +0100
@@ -20,14 +20,17 @@
 
 sys.path[0:0] = [""]
 
+from bson.codec_options import DEFAULT_CODEC_OPTIONS
 from bson.int64 import Int64
 from bson.objectid import ObjectId
+from bson.raw_bson import RawBSONDocument
 from bson.son import SON
 
 
 from pymongo.errors import (ConnectionFailure,
                             OperationFailure,
-                            ServerSelectionTimeoutError)
+                            ServerSelectionTimeoutError,
+                            WriteConcernError)
 from pymongo.mongo_client import MongoClient
 from pymongo.operations import (InsertOne,
                                 DeleteMany,
@@ -43,6 +46,7 @@
                         OvertCommandListener,
                         TestCreator)
 from test.utils_spec_runner import SpecRunner
+from test.version import Version
 
 # Location of JSON test specifications.
 _TEST_PATH = os.path.join(
@@ -454,6 +458,60 @@
         self.assertEqual(coll.find_one(projection={'_id': True}), {'_id': 1})
 
 
+class TestWriteConcernError(IntegrationTest):
+    @classmethod
+    @client_context.require_replica_set
+    @client_context.require_no_mmap
+    @client_context.require_failCommand_fail_point
+    def setUpClass(cls):
+        super(TestWriteConcernError, cls).setUpClass()
+        cls.fail_insert = {
+            'configureFailPoint': 'failCommand',
+            'mode': {'times': 2},
+            'data': {
+                'failCommands': ['insert'],
+                'writeConcernError': {
+                    'code': 91,
+                    'errmsg': 'Replication is being shut down'},
+            }}
+
+    @client_context.require_version_min(4, 0)
+    def test_RetryableWriteError_error_label(self):
+        listener = OvertCommandListener()
+        client = rs_or_single_client(
+            retryWrites=True, event_listeners=[listener])
+
+        # Ensure collection exists.
+        client.pymongo_test.testcoll.insert_one({})
+
+        with self.fail_point(self.fail_insert):
+            with self.assertRaises(WriteConcernError) as cm:
+                client.pymongo_test.testcoll.insert_one({})
+            self.assertTrue(cm.exception.has_error_label(
+                'RetryableWriteError'))
+
+        if client_context.version >= Version(4, 4):
+            # In MongoDB 4.4+ we rely on the server returning the error label.
+            self.assertIn(
+                'RetryableWriteError',
+                listener.results['succeeded'][-1].reply['errorLabels'])
+
+    @client_context.require_version_min(4, 4)
+    def test_RetryableWriteError_error_label_RawBSONDocument(self):
+        # using RawBSONDocument should not cause errorLabel parsing to fail
+        with self.fail_point(self.fail_insert):
+            with self.client.start_session() as s:
+                s._start_retryable_write()
+                result = self.client.pymongo_test.command(
+                    'insert', 'testcoll', documents=[{'_id': 1}],
+                    txnNumber=s._server_session.transaction_id, session=s,
+                    codec_options=DEFAULT_CODEC_OPTIONS.with_options(
+                        document_class=RawBSONDocument))
+
+        self.assertIn('writeConcernError', result)
+        self.assertIn('RetryableWriteError', result['errorLabels'])
+
+
 # TODO: Make this a real integration test where we stepdown the primary.
 class TestRetryableWritesTxnNumber(IgnoreDeprecationsTest):
     @client_context.require_version_min(3, 6)

Reply via email to