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-02-04 20:23:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pymongo (Old)
 and      /work/SRC/openSUSE:Factory/.python-pymongo.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pymongo"

Thu Feb  4 20:23:03 2021 rev:37 rq:868440 version:3.11.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pymongo/python-pymongo.changes    
2020-11-30 09:53:28.153756646 +0100
+++ /work/SRC/openSUSE:Factory/.python-pymongo.new.28504/python-pymongo.changes 
2021-02-04 20:23:52.598808216 +0100
@@ -1,0 +2,15 @@
+Mon Feb  1 18:09:17 UTC 2021 - Dirk M??ller <dmuel...@suse.com>
+
+- update to 3.11.2:
+  - Fixed a memory leak caused by failing SDAM monitor checks on Python 3 
(`PYTHON-2433`_).
+  - Fixed a regression that changed the string representation of
+    :exc:`~pymongo.errors.BulkWriteError` (`PYTHON-2438`_).
+  - Fixed a bug that made it impossible to use
+    :meth:`bson.codec_options.CodecOptions.with_options` and
+    :meth:`~bson.json_util.JSONOptions.with_options` on some early versions of
+    Python 3.4 and Python 3.5 due to a bug in the standard library 
implementation
+    of :meth:`collections.namedtuple._asdict` (`PYTHON-2440`_).
+  - Fixed a bug that resulted in a :exc:`TypeError` exception when a PyOpenSSL
+    socket was configured with a timeout of ``None`` (`PYTHON-2443`_).
+
+-------------------------------------------------------------------

Old:
----
  pymongo-3.11.1.tar.gz

New:
----
  pymongo-3.11.2.tar.gz

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

Other differences:
------------------
++++++ python-pymongo.spec ++++++
--- /var/tmp/diff_new_pack.CtMJKJ/_old  2021-02-04 20:23:53.234809185 +0100
+++ /var/tmp/diff_new_pack.CtMJKJ/_new  2021-02-04 20:23:53.238809190 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-pymongo
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-pymongo
-Version:        3.11.1
+Version:        3.11.2
 Release:        0
 Summary:        Python driver for MongoDB
 License:        Apache-2.0

++++++ pymongo-3.11.1.tar.gz -> pymongo-3.11.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/PKG-INFO new/pymongo-3.11.2/PKG-INFO
--- old/pymongo-3.11.1/PKG-INFO 2020-11-17 01:10:36.000000000 +0100
+++ new/pymongo-3.11.2/PKG-INFO 2020-12-03 00:30:21.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pymongo
-Version: 3.11.1
+Version: 3.11.2
 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: gssapi
 Provides-Extra: zstd
-Provides-Extra: tls
-Provides-Extra: ocsp
-Provides-Extra: encryption
-Provides-Extra: snappy
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/bson/codec_options.py 
new/pymongo-3.11.2/bson/codec_options.py
--- old/pymongo-3.11.1/bson/codec_options.py    2020-11-17 01:08:08.000000000 
+0100
+++ new/pymongo-3.11.2/bson/codec_options.py    2020-12-03 00:29:58.000000000 
+0100
@@ -295,6 +295,17 @@
                  self.unicode_decode_error_handler, self.tzinfo,
                  self.type_registry))
 
+    def _options_dict(self):
+        """Dictionary of the arguments used to create this object."""
+        # TODO: PYTHON-2442 use _asdict() instead
+        return {
+            'document_class': self.document_class,
+            'tz_aware': self.tz_aware,
+            'uuid_representation': self.uuid_representation,
+            'unicode_decode_error_handler': self.unicode_decode_error_handler,
+            'tzinfo': self.tzinfo,
+            'type_registry': self.type_registry}
+
     def __repr__(self):
         return '%s(%s)' % (self.__class__.__name__, self._arguments_repr())
 
@@ -310,7 +321,7 @@
 
         .. versionadded:: 3.5
         """
-        opts = self._asdict()
+        opts = self._options_dict()
         opts.update(kwargs)
         return CodecOptions(**opts)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/bson/json_util.py 
new/pymongo-3.11.2/bson/json_util.py
--- old/pymongo-3.11.1/bson/json_util.py        2020-11-17 01:08:08.000000000 
+0100
+++ new/pymongo-3.11.2/bson/json_util.py        2020-12-03 00:29:58.000000000 
+0100
@@ -311,6 +311,16 @@
                     self.json_mode,
                     super(JSONOptions, self)._arguments_repr()))
 
+    def _options_dict(self):
+        # TODO: PYTHON-2442 use _asdict() instead
+        options_dict = super(JSONOptions, self)._options_dict()
+        options_dict.update({
+            'strict_number_long': self.strict_number_long,
+            'datetime_representation': self.datetime_representation,
+            'strict_uuid': self.strict_uuid,
+            'json_mode': self.json_mode})
+        return options_dict
+
     def with_options(self, **kwargs):
         """
         Make a copy of this JSONOptions, overriding some options::
@@ -324,7 +334,7 @@
 
         .. versionadded:: 3.12
         """
-        opts = self._asdict()
+        opts = self._options_dict()
         for opt in ('strict_number_long', 'datetime_representation',
                     'strict_uuid', 'json_mode'):
             opts[opt] = kwargs.get(opt, getattr(self, opt))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/doc/changelog.rst 
new/pymongo-3.11.2/doc/changelog.rst
--- old/pymongo-3.11.1/doc/changelog.rst        2020-11-17 01:08:08.000000000 
+0100
+++ new/pymongo-3.11.2/doc/changelog.rst        2020-12-03 00:30:07.000000000 
+0100
@@ -1,6 +1,34 @@
 Changelog
 =========
 
+Changes in Version 3.11.2
+-------------------------
+
+Issues Resolved
+...............
+
+Version 3.11.2 includes a number of bugfixes. Highlights include:
+
+- Fixed a memory leak caused by failing SDAM monitor checks on Python 3 
(`PYTHON-2433`_).
+- Fixed a regression that changed the string representation of
+  :exc:`~pymongo.errors.BulkWriteError` (`PYTHON-2438`_).
+- Fixed a bug that made it impossible to use
+  :meth:`bson.codec_options.CodecOptions.with_options` and
+  :meth:`~bson.json_util.JSONOptions.with_options` on some early versions of
+  Python 3.4 and Python 3.5 due to a bug in the standard library implementation
+  of :meth:`collections.namedtuple._asdict` (`PYTHON-2440`_).
+- Fixed a bug that resulted in a :exc:`TypeError` exception when a PyOpenSSL
+  socket was configured with a timeout of ``None`` (`PYTHON-2443`_).
+
+See the `PyMongo 3.11.2 release notes in JIRA`_ for the list of resolved issues
+in this release.
+
+.. _PYTHON-2433: https://jira.mongodb.org/browse/PYTHON-2433
+.. _PYTHON-2438: https://jira.mongodb.org/browse/PYTHON-2438
+.. _PYTHON-2440: https://jira.mongodb.org/browse/PYTHON-2440
+.. _PYTHON-2443: https://jira.mongodb.org/browse/PYTHON-2443
+.. _PyMongo 3.11.2 release notes in JIRA: 
https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10004&version=30315
+
 Changes in Version 3.11.1
 -------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/pymongo/__init__.py 
new/pymongo-3.11.2/pymongo/__init__.py
--- old/pymongo-3.11.1/pymongo/__init__.py      2020-11-17 01:08:08.000000000 
+0100
+++ new/pymongo-3.11.2/pymongo/__init__.py      2020-12-03 00:30:07.000000000 
+0100
@@ -74,7 +74,7 @@
 ALL = 2
 """Profile all operations."""
 
-version_tuple = (3, 11, 1)
+version_tuple = (3, 11, 2)
 
 def get_version_string():
     if isinstance(version_tuple[-1], str):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/pymongo/errors.py 
new/pymongo-3.11.2/pymongo/errors.py
--- old/pymongo-3.11.1/pymongo/errors.py        2020-11-17 01:08:08.000000000 
+0100
+++ new/pymongo-3.11.2/pymongo/errors.py        2020-12-03 00:29:58.000000000 
+0100
@@ -240,8 +240,9 @@
     def __init__(self, results):
         super(BulkWriteError, self).__init__(
             "batch op errors occurred", 65, results)
-        # For pickle support
-        self.args = (results,)
+
+    def __reduce__(self):
+        return self.__class__, (self.details,)
 
 
 class InvalidOperation(PyMongoError):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/pymongo/monitor.py 
new/pymongo-3.11.2/pymongo/monitor.py
--- old/pymongo-3.11.1/pymongo/monitor.py       2020-11-17 01:08:08.000000000 
+0100
+++ new/pymongo-3.11.2/pymongo/monitor.py       2020-12-03 00:29:58.000000000 
+0100
@@ -18,6 +18,8 @@
 import threading
 import weakref
 
+from bson.py3compat import PY3
+
 from pymongo import common, periodic_executor
 from pymongo.errors import (NotMasterError,
                             OperationFailure,
@@ -30,6 +32,14 @@
 from pymongo.srv_resolver import _SrvResolver
 
 
+def _sanitize(error):
+    """PYTHON-2433 Clear error traceback info."""
+    if PY3:
+        error.__traceback__ = None
+        error.__context__ = None
+        error.__cause__ = None
+
+
 class MonitorBase(object):
     def __init__(self, topology, name, interval, min_interval):
         """Base class to do periodic work on a background thread.
@@ -169,6 +179,7 @@
             try:
                 self._server_description = self._check_server()
             except _OperationCancelled as exc:
+                _sanitize(exc)
                 # Already closed the connection, wait for the next check.
                 self._server_description = ServerDescription(
                     self._server_description.address, error=exc)
@@ -212,6 +223,7 @@
         except ReferenceError:
             raise
         except Exception as error:
+            _sanitize(error)
             sd = self._server_description
             address = sd.address
             duration = _time() - start
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/pymongo/socket_checker.py 
new/pymongo-3.11.2/pymongo/socket_checker.py
--- old/pymongo-3.11.1/pymongo/socket_checker.py        2020-11-17 
01:08:08.000000000 +0100
+++ new/pymongo-3.11.2/pymongo/socket_checker.py        2020-12-03 
00:29:58.000000000 +0100
@@ -41,7 +41,7 @@
             self._poller = None
 
     def select(self, sock, read=False, write=False, timeout=0):
-        """Select for reads or writes with a timeout in seconds.
+        """Select for reads or writes with a timeout in seconds (or None).
 
         Returns True if the socket is readable/writable, False on timeout.
         """
@@ -57,7 +57,8 @@
                     try:
                         # poll() timeout is in milliseconds. select()
                         # timeout is in seconds.
-                        res = self._poller.poll(timeout * 1000)
+                        timeout_ = None if timeout is None else timeout * 1000
+                        res = self._poller.poll(timeout_)
                         # poll returns a possibly-empty list containing
                         # (fd, event) 2-tuples for the descriptors that have
                         # events or errors to report. Return True if the list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/pymongo.egg-info/PKG-INFO 
new/pymongo-3.11.2/pymongo.egg-info/PKG-INFO
--- old/pymongo-3.11.1/pymongo.egg-info/PKG-INFO        2020-11-17 
01:10:36.000000000 +0100
+++ new/pymongo-3.11.2/pymongo.egg-info/PKG-INFO        2020-12-03 
00:30:20.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pymongo
-Version: 3.11.1
+Version: 3.11.2
 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: gssapi
 Provides-Extra: zstd
-Provides-Extra: tls
-Provides-Extra: ocsp
-Provides-Extra: encryption
-Provides-Extra: snappy
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/setup.py new/pymongo-3.11.2/setup.py
--- old/pymongo-3.11.1/setup.py 2020-11-17 01:08:08.000000000 +0100
+++ new/pymongo-3.11.2/setup.py 2020-12-03 00:30:07.000000000 +0100
@@ -39,7 +39,7 @@
     except ImportError:
         _HAVE_SPHINX = False
 
-version = "3.11.1"
+version = "3.11.2"
 
 f = open("README.rst")
 try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/test/test_client.py 
new/pymongo-3.11.2/test/test_client.py
--- old/pymongo-3.11.1/test/test_client.py      2020-11-17 01:08:08.000000000 
+0100
+++ new/pymongo-3.11.2/test/test_client.py      2020-12-03 00:29:58.000000000 
+0100
@@ -57,6 +57,7 @@
 from pymongo.driver_info import DriverInfo
 from pymongo.pool import SocketInfo, _METADATA
 from pymongo.read_preferences import ReadPreference
+from pymongo.server_description import ServerDescription
 from pymongo.server_selectors import (any_server_selector,
                                       writable_server_selector)
 from pymongo.server_type import SERVER_TYPE
@@ -279,6 +280,9 @@
             readpreference=ReadPreference.NEAREST.mongos_mode)
         self.assertEqual(c.read_preference, ReadPreference.NEAREST)
 
+    @unittest.skipIf(
+        sys.version_info[0] == 3 and sys.version_info[1] == 4,
+        "PYTHON-2442: workaround namedtuple._asdict() bug on Python 3.4")
     def test_metadata(self):
         metadata = copy.deepcopy(_METADATA)
         metadata['application'] = {'name': 'foobar'}
@@ -1614,6 +1618,35 @@
         with self.assertRaises(ConfigurationError):
             MongoClient(['host1', 'host2'], directConnection=True)
 
+    @unittest.skipIf(sys.platform.startswith('java'),
+                     'Jython does not support gc.get_objects')
+    def test_continuous_network_errors(self):
+        def server_description_count():
+            i = 0
+            for obj in gc.get_objects():
+                try:
+                    if isinstance(obj, ServerDescription):
+                        i += 1
+                except ReferenceError:
+                    pass
+            return i
+        gc.collect()
+        with client_knobs(min_heartbeat_interval=0.003):
+            client = MongoClient(
+                'invalid:27017',
+                heartbeatFrequencyMS=3,
+                serverSelectionTimeoutMS=100)
+            initial_count = server_description_count()
+            self.addCleanup(client.close)
+            with self.assertRaises(ServerSelectionTimeoutError):
+                client.test.test.find_one()
+            gc.collect()
+            final_count = server_description_count()
+            # 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)
+
 
 class TestExhaustCursor(IntegrationTest):
     """Test that clients properly handle errors from exhaust cursors."""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/test/test_errors.py 
new/pymongo-3.11.2/test/test_errors.py
--- old/pymongo-3.11.1/test/test_errors.py      2020-11-17 01:08:08.000000000 
+0100
+++ new/pymongo-3.11.2/test/test_errors.py      2020-12-03 00:29:58.000000000 
+0100
@@ -93,6 +93,7 @@
     def test_pickle_BulkWriteError(self):
         exc = BulkWriteError({})
         self.assertOperationFailureEqual(exc, pickle.loads(pickle.dumps(exc)))
+        self.assertIn("batch op errors occurred", str(exc))
 
     def test_pickle_EncryptionError(self):
         cause = OperationFailure('error', code=5, details={},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/test/test_legacy_api.py 
new/pymongo-3.11.2/test/test_legacy_api.py
--- old/pymongo-3.11.1/test/test_legacy_api.py  2020-11-17 01:08:08.000000000 
+0100
+++ new/pymongo-3.11.2/test/test_legacy_api.py  2020-12-03 00:29:58.000000000 
+0100
@@ -2112,6 +2112,7 @@
                   'op': {'_id': '...', 'b': 6, 'a': 1}}]},
             result)
 
+    @client_context.require_version_max(4, 8)  # PYTHON-2436
     def test_large_inserts_ordered(self):
         big = 'x' * self.coll.database.client.max_bson_size
         batch = self.coll.initialize_ordered_bulk_op()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pymongo-3.11.1/test/test_pooling.py 
new/pymongo-3.11.2/test/test_pooling.py
--- old/pymongo-3.11.1/test/test_pooling.py     2020-11-17 01:08:08.000000000 
+0100
+++ new/pymongo-3.11.2/test/test_pooling.py     2020-12-03 00:30:07.000000000 
+0100
@@ -21,7 +21,10 @@
 import threading
 import time
 
-from pymongo import MongoClient
+from bson.son import SON
+from bson.codec_options import DEFAULT_CODEC_OPTIONS
+
+from pymongo import MongoClient, message
 from pymongo.errors import (AutoReconnect,
                             ConnectionFailure,
                             DuplicateKeyError,
@@ -259,6 +262,37 @@
         s.close()
         self.assertTrue(socket_checker.socket_closed(s))
 
+    def test_socket_checker(self):
+        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+        s.connect((client_context.host, client_context.port))
+        socket_checker = SocketChecker()
+        # Socket has nothing to read.
+        self.assertFalse(socket_checker.select(s, read=True))
+        self.assertFalse(socket_checker.select(s, read=True, timeout=0))
+        self.assertFalse(socket_checker.select(s, read=True, timeout=.05))
+        # Socket is writable.
+        self.assertTrue(socket_checker.select(s, write=True, timeout=None))
+        self.assertTrue(socket_checker.select(s, write=True))
+        self.assertTrue(socket_checker.select(s, write=True, timeout=0))
+        self.assertTrue(socket_checker.select(s, write=True, timeout=.05))
+        # Make the socket readable
+        _, msg, _ = message.query(
+            0, 'admin.$cmd', 0, -1, SON([('isMaster', 1)]), None,
+            DEFAULT_CODEC_OPTIONS)
+        s.sendall(msg)
+        # Block until the socket is readable.
+        self.assertTrue(socket_checker.select(s, read=True, timeout=None))
+        self.assertTrue(socket_checker.select(s, read=True))
+        self.assertTrue(socket_checker.select(s, read=True, timeout=0))
+        self.assertTrue(socket_checker.select(s, read=True, timeout=.05))
+        # Socket is still writable.
+        self.assertTrue(socket_checker.select(s, write=True, timeout=None))
+        self.assertTrue(socket_checker.select(s, write=True))
+        self.assertTrue(socket_checker.select(s, write=True, timeout=0))
+        self.assertTrue(socket_checker.select(s, write=True, timeout=.05))
+        s.close()
+        self.assertTrue(socket_checker.socket_closed(s))
+
     def test_return_socket_after_reset(self):
         pool = self.create_pool()
         with pool.get_socket({}) as sock:

Reply via email to