Hello community, here is the log from the commit of package python-pymongo for openSUSE:Factory checked in at 2013-09-13 14:46:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pymongo (Old) and /work/SRC/openSUSE:Factory/.python-pymongo.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-pymongo" Changes: -------- --- /work/SRC/openSUSE:Factory/python-pymongo/python-pymongo.changes 2013-09-03 22:04:02.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-pymongo.new/python-pymongo.changes 2013-09-13 14:46:20.000000000 +0200 @@ -1,0 +2,9 @@ +Wed Sep 11 21:11:29 UTC 2013 - dmueller@suse.com + +- update to 2.6.2: + Version 2.6.2 fixes a :exc:`TypeError` problem when max_pool_size=None + is used in Python 3. + Version 2.6.1 fixes a reference leak in + the :meth:`~pymongo.collection.Collection.insert` method. + +------------------------------------------------------------------- Old: ---- pymongo-2.6.tar.gz New: ---- pymongo-2.6.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pymongo.spec ++++++ --- /var/tmp/diff_new_pack.XA4k1o/_old 2013-09-13 14:46:20.000000000 +0200 +++ /var/tmp/diff_new_pack.XA4k1o/_new 2013-09-13 14:46:20.000000000 +0200 @@ -17,7 +17,7 @@ Name: python-pymongo -Version: 2.6 +Version: 2.6.2 Release: 0 Url: http://github.com/mongodb/mongo-python-driver Summary: Python driver for MongoDB ++++++ pymongo-2.6.tar.gz -> pymongo-2.6.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymongo-2.6/PKG-INFO new/pymongo-2.6.2/PKG-INFO --- old/pymongo-2.6/PKG-INFO 2013-08-19 21:36:31.000000000 +0200 +++ new/pymongo-2.6.2/PKG-INFO 2013-09-06 22:56:36.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pymongo -Version: 2.6 +Version: 2.6.2 Summary: Python driver for MongoDB http://www.mongodb.org Home-page: http://github.com/mongodb/mongo-python-driver Author: Bernie Hackett diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymongo-2.6/doc/changelog.rst new/pymongo-2.6.2/doc/changelog.rst --- old/pymongo-2.6/doc/changelog.rst 2013-08-19 19:17:17.000000000 +0200 +++ new/pymongo-2.6.2/doc/changelog.rst 2013-09-06 22:44:12.000000000 +0200 @@ -1,6 +1,34 @@ Changelog ========= +Changes in Version 2.6.2 +------------------------ + +Version 2.6.2 fixes a :exc:`TypeError` problem when max_pool_size=None +is used in Python 3. + +Issues Resolved +............... + +See the `PyMongo 2.6.2 release notes in JIRA`_ for the list of resolved issues +in this release. + +.. _PyMongo 2.6.2 release notes in JIRA: https://jira.mongodb.org/browse/PYTHON/fixforversion/12910 + +Changes in Version 2.6.1 +------------------------ + +Version 2.6.1 fixes a reference leak in +the :meth:`~pymongo.collection.Collection.insert` method. + +Issues Resolved +............... + +See the `PyMongo 2.6.1 release notes in JIRA`_ for the list of resolved issues +in this release. + +.. _PyMongo 2.6.1 release notes in JIRA: https://jira.mongodb.org/browse/PYTHON/fixforversion/12905 + Changes in Version 2.6 ---------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymongo-2.6/pymongo/__init__.py new/pymongo-2.6.2/pymongo/__init__.py --- old/pymongo-2.6/pymongo/__init__.py 2013-08-19 20:51:08.000000000 +0200 +++ new/pymongo-2.6.2/pymongo/__init__.py 2013-09-06 22:48:20.000000000 +0200 @@ -67,7 +67,7 @@ ALL = 2 """Profile all operations.""" -version_tuple = (2, 6) +version_tuple = (2, 6, 2) def get_version_string(): if isinstance(version_tuple[-1], basestring): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymongo-2.6/pymongo/_cmessagemodule.c new/pymongo-2.6.2/pymongo/_cmessagemodule.c --- old/pymongo-2.6/pymongo/_cmessagemodule.c 2013-08-15 03:03:37.000000000 +0200 +++ new/pymongo-2.6.2/pymongo/_cmessagemodule.c 2013-09-05 02:11:55.000000000 +0200 @@ -555,6 +555,9 @@ PyObject* client; PyObject* last_error_args; PyObject* result; + PyObject* max_bson_size_obj; + PyObject* max_message_size_obj; + PyObject* send_message_result; unsigned char check_keys; unsigned char safe; unsigned char continue_on_error; @@ -578,24 +581,25 @@ options += 1; } + max_bson_size_obj = PyObject_GetAttrString(client, "max_bson_size"); #if PY_MAJOR_VERSION >= 3 - max_bson_size = PyLong_AsLong( - PyObject_GetAttrString(client, "max_bson_size")); + max_bson_size = PyLong_AsLong(max_bson_size_obj); #else - max_bson_size = PyInt_AsLong( - PyObject_GetAttrString(client, "max_bson_size")); + max_bson_size = PyInt_AsLong(max_bson_size_obj); #endif + Py_XDECREF(max_bson_size_obj); if (max_bson_size == -1) { PyMem_Free(collection_name); return NULL; } + + max_message_size_obj = PyObject_GetAttrString(client, "max_message_size"); #if PY_MAJOR_VERSION >= 3 - max_message_size = PyLong_AsLong( - PyObject_GetAttrString(client, "max_message_size")); + max_message_size = PyLong_AsLong(max_message_size_obj); #else - max_message_size = PyInt_AsLong( - PyObject_GetAttrString(client, "max_message_size")); + max_message_size = PyInt_AsLong(max_message_size_obj); #endif + Py_XDECREF(max_message_size_obj); if (max_message_size == -1) { PyMem_Free(collection_name); return NULL; @@ -707,8 +711,10 @@ request_id = new_request_id; length_location = message_start; - if (!PyObject_CallMethod(client, - "_send_message", "NO", result, send_gle)) { + send_message_result = PyObject_CallMethod(client, "_send_message", + "NO", result, send_gle); + + if (!send_message_result) { PyObject *etype = NULL, *evalue = NULL, *etrace = NULL; PyObject* OperationFailure; PyErr_Fetch(&etype, &evalue, &etrace); @@ -746,6 +752,8 @@ * acknowledged writes. Re-raise immediately. */ PyErr_Restore(etype, evalue, etrace); goto iterfail; + } else { + Py_DECREF(send_message_result); } } } @@ -783,12 +791,17 @@ buffer_free(buffer); /* Send the last (or only) batch */ - if (!PyObject_CallMethod(client, "_send_message", "NN", - result, PyBool_FromLong((long)safe))) { + send_message_result = PyObject_CallMethod(client, "_send_message", "NN", + result, + PyBool_FromLong((long)safe)); + + if (!send_message_result) { Py_XDECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_trace); return NULL; + } else { + Py_DECREF(send_message_result); } if (exc_type) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymongo-2.6/pymongo/pool.py new/pymongo-2.6.2/pymongo/pool.py --- old/pymongo-2.6/pymongo/pool.py 2013-08-16 23:12:51.000000000 +0200 +++ new/pymongo-2.6.2/pymongo/pool.py 2013-09-06 21:40:22.000000000 +0200 @@ -410,8 +410,10 @@ """ try: self.lock.acquire() - if (len(self.sockets) < self.max_size - and sock_info.pool_id == self.pool_id): + too_many_sockets = (self.max_size is not None + and len(self.sockets) >= self.max_size) + + if not too_many_sockets and sock_info.pool_id == self.pool_id: self.sockets.add(sock_info) else: sock_info.close() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymongo-2.6/pymongo.egg-info/PKG-INFO new/pymongo-2.6.2/pymongo.egg-info/PKG-INFO --- old/pymongo-2.6/pymongo.egg-info/PKG-INFO 2013-08-19 21:36:31.000000000 +0200 +++ new/pymongo-2.6.2/pymongo.egg-info/PKG-INFO 2013-09-06 22:56:36.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pymongo -Version: 2.6 +Version: 2.6.2 Summary: Python driver for MongoDB http://www.mongodb.org Home-page: http://github.com/mongodb/mongo-python-driver Author: Bernie Hackett diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymongo-2.6/setup.py new/pymongo-2.6.2/setup.py --- old/pymongo-2.6/setup.py 2013-08-19 20:50:49.000000000 +0200 +++ new/pymongo-2.6.2/setup.py 2013-09-06 22:49:23.000000000 +0200 @@ -31,7 +31,7 @@ from distutils.errors import DistutilsPlatformError, DistutilsExecError from distutils.core import Extension -version = "2.6" +version = "2.6.2" f = open("README.rst") try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymongo-2.6/test/test_collection.py new/pymongo-2.6.2/test/test_collection.py --- old/pymongo-2.6/test/test_collection.py 2013-08-19 19:17:17.000000000 +0200 +++ new/pymongo-2.6.2/test/test_collection.py 2013-09-06 21:59:51.000000000 +0200 @@ -1004,7 +1004,8 @@ self.fail() except OperationFailure, e: if version.at_least(self.db.connection, (1, 3)): - self.assertEqual(10147, e.code) + if e.code not in (10147, 17009): + self.fail() def test_index_on_subfield(self): db = self.db @@ -1890,14 +1891,19 @@ ref_only = {'ref': {'$ref': 'collection'}} id_only = {'ref': {'$id': ObjectId()}} - # Force insert of ref without $id. - c.insert(ref_only, check_keys=False) - self.assertEqual(DBRef('collection', id=None), c.find_one()['ref']) - c.drop() - - # DBRef without $ref is decoded as normal subdocument. - c.insert(id_only, check_keys=False) - self.assertEqual(id_only, c.find_one()) + # Starting with MongoDB 2.5.2 this is no longer possible + # from insert, update, or findAndModify. + if not version.at_least(self.db.connection, (2, 5, 2)): + # Force insert of ref without $id. + c.insert(ref_only, check_keys=False) + self.assertEqual(DBRef('collection', id=None), + c.find_one()['ref']) + + c.drop() + + # DBRef without $ref is decoded as normal subdocument. + c.insert(id_only, check_keys=False) + self.assertEqual(id_only, c.find_one()) def test_as_class(self): c = self.db.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymongo-2.6/test/test_legacy_connections.py new/pymongo-2.6.2/test/test_legacy_connections.py --- old/pymongo-2.6/test/test_legacy_connections.py 2013-08-16 23:12:51.000000000 +0200 +++ new/pymongo-2.6.2/test/test_legacy_connections.py 2013-09-06 21:40:22.000000000 +0200 @@ -49,6 +49,11 @@ c = Connection("mongodb://%s:%s/?safe=true" % (host, port)) self.assertTrue(c.safe) + # To preserve legacy Connection's behavior, max_size should be None. + # Pool should handle this without error. + self.assertEqual(None, c._MongoClient__pool.max_size) + c.end_request() + # Connection's network_timeout argument is translated into # socketTimeoutMS self.assertEqual(123, Connection( @@ -85,6 +90,13 @@ self.assertTrue(c.safe) + # To preserve legacy ReplicaSetConnection's behavior, max_size should + # be None. Pool should handle this without error. + rs_state = c._MongoReplicaSetClient__rs_state + pool = rs_state.primary_member.pool + self.assertEqual(None, pool.max_size) + c.end_request() + # ReplicaSetConnection's network_timeout argument is translated into # socketTimeoutMS self.assertEqual(123, ReplicaSetConnection( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pymongo-2.6/test/test_pooling_base.py new/pymongo-2.6.2/test/test_pooling_base.py --- old/pymongo-2.6/test/test_pooling_base.py 2013-08-16 23:12:51.000000000 +0200 +++ new/pymongo-2.6.2/test/test_pooling_base.py 2013-09-06 21:59:51.000000000 +0200 @@ -788,7 +788,8 @@ recent Gevent development. """ if start_request: - assert max_pool_size >= nthreads, "Deadlock" + if max_pool_size is not None and max_pool_size < nthreads: + raise AssertionError("Deadlock") c = self.get_client( max_pool_size=max_pool_size, auto_start_request=False) @@ -870,7 +871,11 @@ self.sleep(0.1) cx_pool._ident.get() - self.assertEqual(max_pool_size, cx_pool._socket_semaphore.counter) + if max_pool_size is not None: + self.assertEqual( + max_pool_size, + cx_pool._socket_semaphore.counter) + self.assertEqual(0, len(cx_pool._tid_to_sock)) def _test_max_pool_size_no_rendezvous(self, start_request, end_request): @@ -954,6 +959,10 @@ self._test_max_pool_size( start_request=0, end_request=0, nthreads=10, max_pool_size=4) + def test_max_pool_size_none(self): + self._test_max_pool_size( + start_request=0, end_request=0, nthreads=10, max_pool_size=None) + def test_max_pool_size_with_request(self): self._test_max_pool_size( start_request=1, end_request=1, nthreads=10, max_pool_size=10) -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org