Hello community, here is the log from the commit of package python-kombu for openSUSE:Factory checked in at 2013-04-14 10:38:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-kombu (Old) and /work/SRC/openSUSE:Factory/.python-kombu.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-kombu", Maintainer is "radma...@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/python-kombu/python-kombu.changes 2013-04-02 12:52:57.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-kombu.new/python-kombu.changes 2013-04-14 10:38:26.000000000 +0200 @@ -1,0 +2,53 @@ +Sat Apr 13 10:17:23 UTC 2013 - toddrme2...@gmail.com + +- Changes suggests to recommends since suggets are not well supported +- Remove unused patch + +------------------------------------------------------------------- +Fri Apr 12 17:47:22 UTC 2013 - alexan...@exatati.com.br + +- Update to 2.5.10: + Kombu 3 consumers will no longer accept pickle/yaml or msgpack + by default, and you will have to explicitly enable untrusted deserializers + either globally using kombu.enable_insecure_serializers, or + using the accept argument to kombu.Consumer. + - New utility function to disable/enable untrusted serializers. + - kombu.disable_insecure_serializers + - kombu.enable_insecure_serializers + - Consumer: `accept` can now be used to specify a whitelist + of content types to accept. + If the accept whitelist is set and a message is received + with a content type that is not in the whitelist then a + :exc:`~kombu.exceptions.ContentDisallowed` exception + is raised. Note that this error can be handled by the already + existing `on_decode_error` callback + Examples: + Consumer(accept=['application/json']) + Consumer(accept=['pickle', 'json']) + - Now depends on amqp 1.0.11 + - pidbox: Mailbox now supports the `accept` argument. + - Redis: More friendly error for when keys are missing. + - Connection URLs: The parser did not work well when there were + multiple '+' tokens. + +------------------------------------------------------------------- +Thu Apr 11 16:51:37 UTC 2013 - alexan...@exatati.com.br + +- Update to 2.5.9: + - Pidbox: Now warns if there are multiple nodes consuming from + the same pidbox. + - Adds Queue.on_declared <kombu.Queue.on_declared> + A callback to be called when the queue is declared, + with signature (name, messages, consumers). + - Now uses fuzzy matching to suggest alternatives to typos in transport + names. + - SQS: Adds new transport option queue_prefix. + Contributed by j0hnsmith. + - pyamqp: No longer overrides verify_connection. + - SQS: Now specifies the driver_type and driver_name + attributes. + Fix contributed by Mher Movsisyan. + - Fixed bug with kombu.utils.retry_over_time when no errback + specified. + +------------------------------------------------------------------- --- /work/SRC/openSUSE:Factory/python-kombu/python3-kombu.changes 2013-04-02 12:52:57.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-kombu.new/python3-kombu.changes 2013-04-14 10:38:26.000000000 +0200 @@ -1,0 +2,54 @@ +Fri Apr 12 17:47:22 UTC 2013 - alexan...@exatati.com.br + +- Update to 2.5.10: + Kombu 3 consumers will no longer accept pickle/yaml or msgpack + by default, and you will have to explicitly enable untrusted deserializers + either globally using kombu.enable_insecure_serializers, or + using the accept argument to kombu.Consumer. + - New utility function to disable/enable untrusted serializers. + - kombu.disable_insecure_serializers + - kombu.enable_insecure_serializers + - Consumer: `accept` can now be used to specify a whitelist + of content types to accept. + If the accept whitelist is set and a message is received + with a content type that is not in the whitelist then a + :exc:`~kombu.exceptions.ContentDisallowed` exception + is raised. Note that this error can be handled by the already + existing `on_decode_error` callback + Examples: + Consumer(accept=['application/json']) + Consumer(accept=['pickle', 'json']) + - Now depends on amqp 1.0.11 + - pidbox: Mailbox now supports the `accept` argument. + - Redis: More friendly error for when keys are missing. + - Connection URLs: The parser did not work well when there were + multiple '+' tokens. +- Remove unused patch + +------------------------------------------------------------------- +Fri Apr 12 12:06:17 UTC 2013 - toddrme2...@gmail.com + +- Change suggests to recommends since suggests are not well supported +- Disable simplejson on openSUSE <= 12.2 since it is not supported + +------------------------------------------------------------------- +Thu Apr 11 16:51:37 UTC 2013 - alexan...@exatati.com.br + +- Update to 2.5.9: + - Pidbox: Now warns if there are multiple nodes consuming from + the same pidbox. + - Adds Queue.on_declared <kombu.Queue.on_declared> + A callback to be called when the queue is declared, + with signature (name, messages, consumers). + - Now uses fuzzy matching to suggest alternatives to typos in transport + names. + - SQS: Adds new transport option queue_prefix. + Contributed by j0hnsmith. + - pyamqp: No longer overrides verify_connection. + - SQS: Now specifies the driver_type and driver_name + attributes. + Fix contributed by Mher Movsisyan. + - Fixed bug with kombu.utils.retry_over_time when no errback + specified. + +------------------------------------------------------------------- Old: ---- accept-newer-amqp-versions.diff kombu-2.5.8.tar.gz New: ---- kombu-2.5.10.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-kombu.spec ++++++ --- /var/tmp/diff_new_pack.hNs8k8/_old 2013-04-14 10:38:27.000000000 +0200 +++ /var/tmp/diff_new_pack.hNs8k8/_new 2013-04-14 10:38:27.000000000 +0200 @@ -17,14 +17,13 @@ Name: python-kombu -Version: 2.5.8 +Version: 2.5.10 Release: 0 Summary: AMQP Messaging Framework for Python License: BSD-3-Clause Group: Development/Languages/Python Url: http://github.com/ask/kombu/ Source: http://pypi.python.org/packages/source/k/kombu/kombu-%{version}.tar.gz -Patch0: accept-newer-amqp-versions.diff BuildRequires: python-PyYAML BuildRequires: python-amqplib BuildRequires: python-anyjson @@ -35,15 +34,15 @@ BuildRequires: python-nose-cover3 BuildRequires: python-simplejson BuildRequires: python-unittest2 >= 0.5.0 -Requires: python-amqp >= 1.0.8 +Requires: python-amqp >= 1.0.11 Requires: python-anyjson >= 0.3.3 %if 0%{?suse_version} && 0%{?suse_version} <= 1110 Requires: python-importlib Requires: python-ordereddict %endif -Suggests: couchdb -Suggests: mongodb -Suggests: rabbitmq-server +Recommends: couchdb +Recommends: mongodb +Recommends: rabbitmq-server BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} && 0%{?suse_version} <= 1110 %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} @@ -65,7 +64,6 @@ %prep %setup -q -n kombu-%{version} -%patch0 # For rpmlint warning: remove shebang from python library: sed -i '/^#!/d' ./kombu/tests/test_serialization.py # NOTE(saschpe): We have a newer python-amqp, but this shouldn't be an issue: ++++++ python3-kombu.spec ++++++ --- /var/tmp/diff_new_pack.hNs8k8/_old 2013-04-14 10:38:27.000000000 +0200 +++ /var/tmp/diff_new_pack.hNs8k8/_new 2013-04-14 10:38:27.000000000 +0200 @@ -17,14 +17,13 @@ Name: python3-kombu -Version: 2.5.8 +Version: 2.5.10 Release: 0 Summary: AMQP Messaging Framework for Python License: BSD-2-Clause Group: Development/Languages/Python Url: http://github.com/ask/kombu/ Source: http://pypi.python.org/packages/source/k/kombu/kombu-%{version}.tar.gz -Patch0: accept-newer-amqp-versions.diff BuildRequires: python3 BuildRequires: python3-PyYAML BuildRequires: python3-amqplib @@ -34,13 +33,15 @@ BuildRequires: python3-mock BuildRequires: python3-msgpack-python BuildRequires: python3-nose-cover3 +%if 0%{?suse_version} >= 1230 BuildRequires: python3-simplejson +%endif BuildRequires: python3-unittest2 -Requires: python3-amqp >= 1.0.8 +Requires: python3-amqp >= 1.0.11 Requires: python3-anyjson -Suggests: couchdb -Suggests: mongodb -Suggests: rabbitmq-server +Recommends: couchdb +Recommends: mongodb +Recommends: rabbitmq-server BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch @@ -58,7 +59,6 @@ %prep %setup -q -n kombu-%{version} -%patch0 # For rpmlint warning: remove shebang from python library: sed -i '/^#!/d' ./kombu/tests/test_serialization.py ++++++ kombu-2.5.8.tar.gz -> kombu-2.5.10.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/Changelog new/kombu-2.5.10/Changelog --- old/kombu-2.5.8/Changelog 2013-03-21 17:05:26.000000000 +0100 +++ new/kombu-2.5.10/Changelog 2013-04-11 19:11:52.000000000 +0200 @@ -4,6 +4,83 @@ Change history ================ +.. _version-2.5.10: + +2.5.10 +====== +:release-date: 2013-04-11 18:10 P.M BST + +Note about upcoming changes for Kombu 3.0 +----------------------------------------- + +Kombu 3 consumers will no longer accept pickle/yaml or msgpack +by default, and you will have to explicitly enable untrusted deserializers +either globally using :func:`kombu.enable_insecure_serializers`, or +using the ``accept`` argument to :class:`~kombu.Consumer`. + +Changes +------- + +- New utility function to disable/enable untrusted serializers. + + - :func:`kombu.disable_insecure_serializers` + - :func:`kombu.enable_insecure_serializers`. + +- Consumer: ``accept`` can now be used to specify a whitelist + of content types to accept. + + If the accept whitelist is set and a message is received + with a content type that is not in the whitelist then a + :exc:`~kombu.exceptions.ContentDisallowed` exception + is raised. Note that this error can be handled by the already + existing `on_decode_error` callback + + Examples:: + + Consumer(accept=['application/json']) + Consumer(accept=['pickle', 'json']) + +- Now depends on amqp 1.0.11 + +- pidbox: Mailbox now supports the ``accept`` argument. + +- Redis: More friendly error for when keys are missing. + +- Connection URLs: The parser did not work well when there were + multiple '+' tokens. + +.. _version-2.5.9: + +2.5.9 +===== +:release-date: 2013-04-08 05:07 P.M BST + +- Pidbox: Now warns if there are multiple nodes consuming from + the same pidbox. + +- Adds :attr:`Queue.on_declared <kombu.Queue.on_declared>` + + A callback to be called when the queue is declared, + with signature ``(name, messages, consumers)``. + +- Now uses fuzzy matching to suggest alternatives to typos in transport + names. + +- SQS: Adds new transport option ``queue_prefix``. + + Contributed by j0hnsmith. + +- pyamqp: No longer overrides verify_connection. + +- SQS: Now specifies the ``driver_type`` and ``driver_name`` + attributes. + + Fix contributed by Mher Movsisyan. + +- Fixed bug with ``kombu.utils.retry_over_time`` when no errback + specified. + + .. _version-2.5.8: 2.5.8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/PKG-INFO new/kombu-2.5.10/PKG-INFO --- old/kombu-2.5.8/PKG-INFO 2013-03-21 17:27:24.000000000 +0100 +++ new/kombu-2.5.10/PKG-INFO 2013-04-11 19:12:33.000000000 +0200 @@ -1,16 +1,18 @@ Metadata-Version: 1.1 Name: kombu -Version: 2.5.8 +Version: 2.5.10 Summary: Messaging Framework for Python Home-page: http://kombu.readthedocs.org Author: Ask Solem Author-email: a...@celeryproject.org License: UNKNOWN -Description: ======================================== +Description: .. _kombu-index: + + ======================================== kombu - Messaging Framework for Python ======================================== - :Version: 2.5.8 + :Version: 2.5.10 `Kombu` is a messaging framework for Python. @@ -81,6 +83,8 @@ .. _`librabbitmq`: http://pypi.python.org/pypi/librabbitmq + .. _transport-comparison: + Transport Comparison ==================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/README new/kombu-2.5.10/README --- old/kombu-2.5.8/README 2013-03-21 17:05:44.000000000 +0100 +++ new/kombu-2.5.10/README 2013-04-11 19:12:15.000000000 +0200 @@ -1,8 +1,10 @@ +.. _kombu-index: + ======================================== kombu - Messaging Framework for Python ======================================== -:Version: 2.5.8 +:Version: 2.5.10 `Kombu` is a messaging framework for Python. @@ -73,6 +75,8 @@ .. _`librabbitmq`: http://pypi.python.org/pypi/librabbitmq +.. _transport-comparison: + Transport Comparison ==================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/README.rst new/kombu-2.5.10/README.rst --- old/kombu-2.5.8/README.rst 2013-03-21 17:05:44.000000000 +0100 +++ new/kombu-2.5.10/README.rst 2013-04-11 19:12:15.000000000 +0200 @@ -1,8 +1,10 @@ +.. _kombu-index: + ======================================== kombu - Messaging Framework for Python ======================================== -:Version: 2.5.8 +:Version: 2.5.10 `Kombu` is a messaging framework for Python. @@ -73,6 +75,8 @@ .. _`librabbitmq`: http://pypi.python.org/pypi/librabbitmq +.. _transport-comparison: + Transport Comparison ==================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/docs/changelog.rst new/kombu-2.5.10/docs/changelog.rst --- old/kombu-2.5.8/docs/changelog.rst 2013-03-21 17:05:26.000000000 +0100 +++ new/kombu-2.5.10/docs/changelog.rst 2013-04-11 19:11:52.000000000 +0200 @@ -4,6 +4,83 @@ Change history ================ +.. _version-2.5.10: + +2.5.10 +====== +:release-date: 2013-04-11 18:10 P.M BST + +Note about upcoming changes for Kombu 3.0 +----------------------------------------- + +Kombu 3 consumers will no longer accept pickle/yaml or msgpack +by default, and you will have to explicitly enable untrusted deserializers +either globally using :func:`kombu.enable_insecure_serializers`, or +using the ``accept`` argument to :class:`~kombu.Consumer`. + +Changes +------- + +- New utility function to disable/enable untrusted serializers. + + - :func:`kombu.disable_insecure_serializers` + - :func:`kombu.enable_insecure_serializers`. + +- Consumer: ``accept`` can now be used to specify a whitelist + of content types to accept. + + If the accept whitelist is set and a message is received + with a content type that is not in the whitelist then a + :exc:`~kombu.exceptions.ContentDisallowed` exception + is raised. Note that this error can be handled by the already + existing `on_decode_error` callback + + Examples:: + + Consumer(accept=['application/json']) + Consumer(accept=['pickle', 'json']) + +- Now depends on amqp 1.0.11 + +- pidbox: Mailbox now supports the ``accept`` argument. + +- Redis: More friendly error for when keys are missing. + +- Connection URLs: The parser did not work well when there were + multiple '+' tokens. + +.. _version-2.5.9: + +2.5.9 +===== +:release-date: 2013-04-08 05:07 P.M BST + +- Pidbox: Now warns if there are multiple nodes consuming from + the same pidbox. + +- Adds :attr:`Queue.on_declared <kombu.Queue.on_declared>` + + A callback to be called when the queue is declared, + with signature ``(name, messages, consumers)``. + +- Now uses fuzzy matching to suggest alternatives to typos in transport + names. + +- SQS: Adds new transport option ``queue_prefix``. + + Contributed by j0hnsmith. + +- pyamqp: No longer overrides verify_connection. + +- SQS: Now specifies the ``driver_type`` and ``driver_name`` + attributes. + + Fix contributed by Mher Movsisyan. + +- Fixed bug with ``kombu.utils.retry_over_time`` when no errback + specified. + + .. _version-2.5.8: 2.5.8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/docs/introduction.rst new/kombu-2.5.10/docs/introduction.rst --- old/kombu-2.5.8/docs/introduction.rst 2013-03-21 17:05:44.000000000 +0100 +++ new/kombu-2.5.10/docs/introduction.rst 2013-04-11 19:12:15.000000000 +0200 @@ -1,8 +1,10 @@ +.. _kombu-index: + ======================================== kombu - Messaging Framework for Python ======================================== -:Version: 2.5.8 +:Version: 2.5.10 `Kombu` is a messaging framework for Python. @@ -73,6 +75,8 @@ .. _`librabbitmq`: http://pypi.python.org/pypi/librabbitmq +.. _transport-comparison: + Transport Comparison ==================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/docs/reference/index.rst new/kombu-2.5.10/docs/reference/index.rst --- old/kombu-2.5.8/docs/reference/index.rst 2013-03-21 15:01:12.000000000 +0100 +++ new/kombu-2.5.10/docs/reference/index.rst 2013-04-11 18:57:56.000000000 +0200 @@ -55,4 +55,5 @@ kombu.utils.functional kombu.utils.finalize kombu.utils.url + kombu.utils.text kombu.utils.amq_manager diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/docs/reference/kombu.rst new/kombu-2.5.10/docs/reference/kombu.rst --- old/kombu-2.5.8/docs/reference/kombu.rst 2013-03-21 15:01:12.000000000 +0100 +++ new/kombu-2.5.10/docs/reference/kombu.rst 2013-04-11 18:57:56.000000000 +0200 @@ -5,6 +5,10 @@ .. automodule:: kombu + .. autofunction:: enable_insecure_serializers + + .. autofunction:: disable_insecure_serializers + Connection ---------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/docs/reference/kombu.utils.text.rst new/kombu-2.5.10/docs/reference/kombu.utils.text.rst --- old/kombu-2.5.8/docs/reference/kombu.utils.text.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/kombu-2.5.10/docs/reference/kombu.utils.text.rst 2013-04-08 15:42:59.000000000 +0200 @@ -0,0 +1,11 @@ +========================================================== + Text utilitites - kombu.utils.text +========================================================== + +.. contents:: + :local: +.. currentmodule:: kombu.utils.text + +.. automodule:: kombu.utils.text + :members: + :undoc-members: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/docs/userguide/serialization.rst new/kombu-2.5.10/docs/userguide/serialization.rst --- old/kombu-2.5.8/docs/userguide/serialization.rst 2012-12-18 17:38:13.000000000 +0100 +++ new/kombu-2.5.10/docs/userguide/serialization.rst 2013-04-11 18:57:56.000000000 +0200 @@ -77,6 +77,33 @@ They can auto-detect the serialization method as the content-type is sent as a message header. +.. _disable-untrusted-serializers: + +Disabling Insecure Serializers +------------------------------ + +.. versionadded:: 2.5.10 + +Deserializing pickle and yaml from untrusted sources is not safe, +as both pickle and yaml have the ability to execute arbitrary code. + +If you are not using these formats you should disable them +by calling :func:`kombu.disable_insecure_serializers`:: + + >>> import kombu + >>> kombu.disable_insecure_serializers() + +Or you can specify the content types your consumers should +accept by using the ``accept`` argument:: + + >>> Consumer(accept=['json', 'pickle']) + >>> Consumer(accept=['application/json']) + +.. note:: + + Insecure serializers will be disabled by default + in the next major version (Kombu 3.0) + .. _sending-raw-data: Sending raw data without Serialization diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/__init__.py new/kombu-2.5.10/kombu/__init__.py --- old/kombu-2.5.8/kombu/__init__.py 2013-03-21 17:05:44.000000000 +0100 +++ new/kombu-2.5.10/kombu/__init__.py 2013-04-11 19:12:15.000000000 +0200 @@ -1,7 +1,7 @@ """Messaging Framework for Python""" from __future__ import absolute_import -VERSION = (2, 5, 8) +VERSION = (2, 5, 10) __version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) __author__ = 'Ask Solem' __contact__ = 'a...@celeryproject.org' @@ -33,18 +33,24 @@ from kombu.pools import connections, producers # noqa from kombu.utils.url import parse_url # noqa from kombu.common import eventloop, uuid # noqa + from kombu.serialization import ( # noqa + enable_insecure_serializers, + disable_insecure_serializers, + ) # Lazy loading. # - See werkzeug/__init__.py for the rationale behind this. from types import ModuleType all_by_module = { - 'kombu.connection': ['Connection', 'BrokerConnection'], - 'kombu.entity': ['Exchange', 'Queue', 'binding'], - 'kombu.messaging': ['Consumer', 'Producer'], - 'kombu.pools': ['connections', 'producers'], - 'kombu.utils.url': ['parse_url'], - 'kombu.common': ['eventloop', 'uuid'] + 'kombu.connection': ['Connection', 'BrokerConnection'], + 'kombu.entity': ['Exchange', 'Queue', 'binding'], + 'kombu.messaging': ['Consumer', 'Producer'], + 'kombu.pools': ['connections', 'producers'], + 'kombu.utils.url': ['parse_url'], + 'kombu.common': ['eventloop', 'uuid'], + 'kombu.serialization': ['enable_insecure_serializers', + 'disable_insecure_serializers'], } object_origins = {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/connection.py new/kombu-2.5.10/kombu/connection.py --- old/kombu-2.5.8/kombu/connection.py 2013-03-21 15:01:12.000000000 +0100 +++ new/kombu-2.5.10/kombu/connection.py 2013-04-11 18:57:56.000000000 +0200 @@ -171,7 +171,8 @@ hostname = alt[0] if '+' in hostname[:hostname.index('://')]: # e.g. sqla+mysql://root:masterkey@localhost/ - params['transport'], params['hostname'] = hostname.split('+') + params['transport'], params['hostname'] = \ + hostname.split('+', 1) self.uri_prefix = params['transport'] else: if transport not in URI_PASSTHROUGH: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/entity.py new/kombu-2.5.10/kombu/entity.py --- old/kombu-2.5.8/kombu/entity.py 2013-03-21 16:26:34.000000000 +0100 +++ new/kombu-2.5.10/kombu/entity.py 2013-04-08 15:42:59.000000000 +0200 @@ -125,12 +125,14 @@ auto_delete = False delivery_mode = PERSISTENT_DELIVERY_MODE - attrs = (('name', None), - ('type', None), - ('arguments', None), - ('durable', bool), - ('auto_delete', bool), - ('delivery_mode', lambda m: DELIVERY_MODES.get(m) or m)) + attrs = ( + ('name', None), + ('type', None), + ('arguments', None), + ('durable', bool), + ('auto_delete', bool), + ('delivery_mode', lambda m: DELIVERY_MODES.get(m) or m), + ) def __init__(self, name='', type='', channel=None, **kwargs): super(Exchange, self).__init__(**kwargs) @@ -332,6 +334,7 @@ :keyword auto_delete: See :attr:`auto_delete`. :keyword queue_arguments: See :attr:`queue_arguments`. :keyword binding_arguments: See :attr:`binding_arguments`. + :keyword on_declared: See :attr:`on_declared` .. attribute:: name @@ -413,6 +416,13 @@ For example to give alternate names to queues with automatically generated queue names. + .. attribute:: on_declared + + Optional callback to be applied when the queue has been + declared (the ``queue_declare`` method returns). + This must be function with a signature that accepts at least 3 + positional arguments: ``(name, messages, consumers)``. + """ name = '' exchange = Exchange('') @@ -423,25 +433,29 @@ auto_delete = False no_ack = False - attrs = (('name', None), - ('exchange', None), - ('routing_key', None), - ('queue_arguments', None), - ('binding_arguments', None), - ('durable', bool), - ('exclusive', bool), - ('auto_delete', bool), - ('no_ack', None), - ('alias', None), - ('bindings', list)) + attrs = ( + ('name', None), + ('exchange', None), + ('routing_key', None), + ('queue_arguments', None), + ('binding_arguments', None), + ('durable', bool), + ('exclusive', bool), + ('auto_delete', bool), + ('no_ack', None), + ('alias', None), + ('bindings', list), + ) def __init__(self, name='', exchange=None, routing_key='', - channel=None, bindings=None, **kwargs): + channel=None, bindings=None, on_declared=None, + **kwargs): super(Queue, self).__init__(**kwargs) self.name = name or self.name self.exchange = exchange or self.exchange self.routing_key = routing_key or self.routing_key self.bindings = set(bindings or []) + self.on_declared = on_declared # allows Queue('name', [binding(...), binding(...), ...]) if isinstance(exchange, (list, tuple, set)): @@ -454,6 +468,12 @@ self.auto_delete = True self.maybe_bind(channel) + def bind(self, channel): + on_declared = self.on_declared + bound = super(Queue, self).bind(channel) + bound.on_declared = on_declared + return bound + def __hash__(self): return hash('Q|%s' % (self.name, )) @@ -496,6 +516,8 @@ nowait=nowait) if not self.name: self.name = ret[0] + if self.on_declared: + self.on_declared(*ret) return ret def queue_bind(self, nowait=False): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/exceptions.py new/kombu-2.5.10/kombu/exceptions.py --- old/kombu-2.5.8/kombu/exceptions.py 2013-03-21 15:01:12.000000000 +0100 +++ new/kombu-2.5.10/kombu/exceptions.py 2013-04-11 18:57:56.000000000 +0200 @@ -63,6 +63,11 @@ pass +class ContentDisallowed(SerializerNotInstalled): + """Consumer does not allow this content-type.""" + pass + + class InconsistencyError(StdConnectionError): """Data or environment has been found to be inconsistent, depending on the cause it may be possible to retry the operation.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/messaging.py new/kombu-2.5.10/kombu/messaging.py --- old/kombu-2.5.8/kombu/messaging.py 2013-03-21 15:01:12.000000000 +0100 +++ new/kombu-2.5.10/kombu/messaging.py 2013-04-11 18:57:56.000000000 +0200 @@ -12,7 +12,7 @@ from .connection import maybe_channel, is_connection from .entity import Exchange, Queue, DELIVERY_MODES from .compression import compress -from .serialization import encode +from .serialization import encode, registry from .utils import ChannelPromise, maybe_list __all__ = ['Exchange', 'Queue', 'Producer', 'Consumer'] @@ -318,10 +318,20 @@ #: that occurred while trying to decode it. on_decode_error = None + #: List of accepted content-types. + #: + #: An exception will be raised if the consumer receives + #: a message with an untrusted content type. + #: By default all content-types are accepted, but not if + #: :func:`kombu.disable_untrusted_serializers` was called, + #: in which case only json is allowed. + accept = None + _next_tag = count(1).next # global def __init__(self, channel, queues=None, no_ack=None, auto_declare=None, - callbacks=None, on_decode_error=None, on_message=None): + callbacks=None, on_decode_error=None, on_message=None, + accept=None): self.channel = channel self.queues = self.queues or [] if queues is None else queues self.no_ack = self.no_ack if no_ack is None else no_ack @@ -333,6 +343,13 @@ self.auto_declare = auto_declare if on_decode_error is not None: self.on_decode_error = on_decode_error + self.accept = accept + + if self.accept is not None: + self.accept = set( + n if '/' in n else registry.name_to_type[n] + for n in self.accept + ) if self.channel: self.revive(self.channel) @@ -528,6 +545,9 @@ return tag def _receive_callback(self, message): + accept = self.accept + if accept is not None: + message.accept = accept on_m, channel, decoded = self.on_message, self.channel, None try: m2p = getattr(channel, 'message_to_python', None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/pidbox.py new/kombu-2.5.10/kombu/pidbox.py --- old/kombu-2.5.8/kombu/pidbox.py 2013-03-21 15:01:12.000000000 +0100 +++ new/kombu-2.5.10/kombu/pidbox.py 2013-04-11 18:57:56.000000000 +0200 @@ -9,6 +9,7 @@ from __future__ import with_statement import socket +import warnings from collections import defaultdict, deque from copy import copy @@ -23,6 +24,14 @@ REPLY_QUEUE_EXPIRES = 10 +W_PIDBOX_IN_USE = """\ +A node named %(hostname)r is already using this process mailbox! + +Maybe you forgot to shutdown the other node or did not do so properly? +Or if you meant to start multiple nodes on the same host please make sure +you give each node a unique node name! +""" + __all__ = ['Node', 'Mailbox'] @@ -56,9 +65,15 @@ def Consumer(self, channel=None, **options): options.setdefault('no_ack', True) - return Consumer(channel or self.channel, - [self.mailbox.get_queue(self.hostname)], - **options) + options.setdefault('accept', self.mailbox.accept) + queue = self.mailbox.get_queue(self.hostname) + + def verify_exclusive(name, messages, consumers): + if consumers: + warnings.warn(W_PIDBOX_IN_USE % {'hostname': self.hostname}) + queue.on_declared = verify_exclusive + + return Consumer(channel or self.channel, [queue], **options) def handler(self, fun): self.handlers[fun.__name__] = fun @@ -131,7 +146,8 @@ #: exchange to send replies to. reply_exchange = None - def __init__(self, namespace, type='direct', connection=None, clock=None): + def __init__(self, namespace, + type='direct', connection=None, clock=None, accept=None): self.namespace = namespace self.connection = connection self.type = type @@ -140,6 +156,7 @@ self.reply_exchange = self._get_reply_exchange(self.namespace) self._tls = local() self.unclaimed = defaultdict(deque) + self.accept = accept def __call__(self, connection): bound = copy(self) @@ -250,10 +267,13 @@ channel=chan) def _collect(self, ticket, - limit=None, timeout=1, callback=None, channel=None): + limit=None, timeout=1, callback=None, + channel=None, accept=None): + if accept is None: + accept = self.accept chan = channel or self.connection.default_channel queue = self.reply_queue - consumer = Consumer(channel, [queue], no_ack=True) + consumer = Consumer(channel, [queue], accept=accept, no_ack=True) responses = [] unclaimed = self.unclaimed adjust_clock = self.clock.adjust diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/serialization.py new/kombu-2.5.10/kombu/serialization.py --- old/kombu-2.5.8/kombu/serialization.py 2013-03-21 15:01:12.000000000 +0100 +++ new/kombu-2.5.10/kombu/serialization.py 2013-04-11 18:57:56.000000000 +0200 @@ -18,7 +18,7 @@ except ImportError: # pragma: no cover cpickle = None # noqa -from .exceptions import SerializerNotInstalled +from .exceptions import SerializerNotInstalled, ContentDisallowed from .utils import entrypoints from .utils.encoding import str_to_bytes, bytes_t @@ -68,15 +68,16 @@ #: There's a new protocol (3) but this is only supported by Python 3. pickle_protocol = int(os.environ.get('PICKLE_PROTOCOL', 2)) -#: Kombu requires Python 2.5 or later so we use protocol 2 by default. -#: There's a new protocol (3) but this is only supported by Python 3. -pickle_protocol = int(os.environ.get('PICKLE_PROTOCOL', 2)) - def pickle_loads(s, load=pickle_load): + # used to support buffer objects return load(BytesIO(s)) +def parenthesize_alias(first, second): + return '%s (%s)' % (first, second) if first else second + + class SerializerRegistry(object): """The registry keeps track of serialization methods.""" @@ -88,6 +89,7 @@ self._default_content_encoding = None self._disabled_content_types = set() self.type_to_name = {} + self.name_to_type = {} def register(self, name, encoder, decoder, content_type, content_encoding='utf-8'): @@ -96,18 +98,25 @@ if decoder: self._decoders[content_type] = decoder self.type_to_name[content_type] = name + self.name_to_type[name] = content_type + + def enable(self, name): + if '/' not in name: + name = self.name_to_type[name] + self._disabled_content_types.remove(name) def disable(self, name): if '/' not in name: - name, _, _ = self._encoders[name] + name = self.name_to_type[name] self._disabled_content_types.add(name) def unregister(self, name): try: - content_type = self._encoders[name][0] + content_type = self.name_to_type[name] self._decoders.pop(content_type, None) self._encoders.pop(name, None) self.type_to_name.pop(content_type, None) + self.name_to_type.pop(name, None) except KeyError: raise SerializerNotInstalled( 'No encoder/decoder installed for %s' % name) @@ -161,10 +170,14 @@ payload = encoder(data) return content_type, content_encoding, payload - def decode(self, data, content_type, content_encoding, force=False): - if content_type in self._disabled_content_types and not force: - raise SerializerNotInstalled( - 'Content-type %r has been disabled.' % (content_type, )) + def decode(self, data, content_type, content_encoding, + accept=None, force=False): + if accept is not None: + if content_type not in accept: + raise self._for_untrusted_content(content_type, 'untrusted') + else: + if content_type in self._disabled_content_types and not force: + raise self._for_untrusted_content(content_type, 'disabled') content_type = content_type or 'application/data' content_encoding = (content_encoding or 'utf-8').lower() @@ -177,13 +190,16 @@ return _decode(data, content_encoding) return data + def _for_untrusted_content(self, ctype, why): + return ContentDisallowed( + 'Refusing to decode %(why)s content of type %(type)s' % { + 'why': why, + 'type': parenthesize_alias(self.type_to_name[ctype], ctype), + }, + ) -""" -.. data:: registry - -Global registry of serializers/deserializers. -""" +#: Global registry of serializers/deserializers. registry = SerializerRegistry() @@ -378,6 +394,53 @@ # (this matches the historical use of kombu.) registry._set_default_serializer('json') + +_setupfuns = { + 'json': register_json, + 'pickle': register_pickle, + 'yaml': register_yaml, + 'msgpack': register_msgpack, + 'application/json': register_json, + 'application/x-yaml': register_yaml, + 'application/x-python-serialize': register_pickle, + 'application/x-msgpack': register_msgpack, +} + + +def enable_insecure_serializers(choices=['pickle', 'yaml', 'msgpack']): + """Enable serializers that are considered to be unsafe. + + Will enable ``pickle``, ``yaml`` and ``msgpack`` by default, + but you can also specify a list of serializers (by name or content type) + to enable. + + """ + for choice in choices: + try: + registry.enable(choice) + except KeyError: + pass + + +def disable_insecure_serializers(allowed=['json']): + """Disable untrusted serializers. + + Will disable all serializers except ``json`` + or you can specify a list of deserializers to allow. + + .. note:: + + Producers will still be able to serialize data + in these formats, but consumers will not accept + incoming data using the untrusted content types. + + """ + for name in registry._decoders: + registry.disable(name) + if allowed is not None: + for name in allowed: + registry.enable(name) + # Load entrypoints from installed extensions for ep, args in entrypoints('kombu.serializers'): register(ep.name, *args) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/tests/transport/test_pyamqp.py new/kombu-2.5.10/kombu/tests/transport/test_pyamqp.py --- old/kombu-2.5.8/kombu/tests/transport/test_pyamqp.py 2013-03-21 15:01:12.000000000 +0100 +++ new/kombu-2.5.10/kombu/tests/transport/test_pyamqp.py 2013-04-11 18:57:56.000000000 +0200 @@ -121,14 +121,6 @@ self.assertIsNone(connection.client) connection.close.assert_called_with() - def test_verify_connection(self): - connection = Mock() - connection.channels = None - self.assertFalse(self.transport.verify_connection(connection)) - - connection.channels = {1: 1, 2: 2} - self.assertTrue(self.transport.verify_connection(connection)) - @mask_modules('ssl') def test_import_no_ssl(self): pm = sys.modules.pop('amqp.connection') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/transport/SQS.py new/kombu-2.5.10/kombu/transport/SQS.py --- old/kombu-2.5.8/kombu/transport/SQS.py 2013-03-21 16:11:14.000000000 +0100 +++ new/kombu-2.5.10/kombu/transport/SQS.py 2013-04-11 18:57:56.000000000 +0200 @@ -147,7 +147,7 @@ # exists with a different visibility_timeout, so this prepopulates # the queue_cache to protect us from recreating # queues that are known to already exist. - queues = self.sqs.get_all_queues() + queues = self.sqs.get_all_queues(prefix=self.queue_name_prefix) for queue in queues: self._queue_cache[queue.name] = queue @@ -375,3 +375,5 @@ default_port = None connection_errors = (StdConnectionError, exception.SQSError, socket.error) channel_errors = (exception.SQSDecodeError, StdChannelError) + driver_type = 'sqs' + driver_name = 'sqs' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/transport/__init__.py new/kombu-2.5.10/kombu/transport/__init__.py --- old/kombu-2.5.8/kombu/transport/__init__.py 2013-03-21 15:01:12.000000000 +0100 +++ new/kombu-2.5.10/kombu/transport/__init__.py 2013-04-11 18:57:56.000000000 +0200 @@ -76,6 +76,12 @@ transport = TRANSPORT_ALIASES[transport] except KeyError: if '.' not in transport and ':' not in transport: + from kombu.utils.text import fmatch_best + alt = fmatch_best(transport, TRANSPORT_ALIASES) + if alt: + raise KeyError( + 'No such transport: %s. Did you mean %s?' % ( + transport, alt)) raise KeyError('No such transport: %s' % transport) else: if callable(transport): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/transport/base.py new/kombu-2.5.10/kombu/transport/base.py --- old/kombu-2.5.8/kombu/transport/base.py 2013-03-21 15:01:12.000000000 +0100 +++ new/kombu-2.5.10/kombu/transport/base.py 2013-04-11 18:57:56.000000000 +0200 @@ -47,12 +47,13 @@ __slots__ = ('_state', 'channel', 'delivery_tag', 'content_type', 'content_encoding', 'delivery_info', 'headers', 'properties', - 'body', '_decoded_cache', '__dict__') + 'body', '_decoded_cache', 'accept', '__dict__') MessageStateError = MessageStateError def __init__(self, channel, body=None, delivery_tag=None, content_type=None, content_encoding=None, delivery_info={}, - properties=None, headers=None, postencode=None, **kwargs): + properties=None, headers=None, postencode=None, + accept=None, **kwargs): self.channel = channel self.delivery_tag = delivery_tag self.content_type = content_type @@ -62,6 +63,7 @@ self.properties = properties or {} self._decoded_cache = None self._state = 'RECEIVED' + self.accept = accept try: body = decompress(body, self.headers['compression']) @@ -142,7 +144,7 @@ """Deserialize the message body, returning the original python structure sent by the publisher.""" return decode(self.body, self.content_type, - self.content_encoding) + self.content_encoding, accept=self.accept) @property def acknowledged(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/transport/pyamqp.py new/kombu-2.5.10/kombu/transport/pyamqp.py --- old/kombu-2.5.8/kombu/transport/pyamqp.py 2013-03-21 15:01:12.000000000 +0100 +++ new/kombu-2.5.10/kombu/transport/pyamqp.py 2013-04-11 18:57:56.000000000 +0200 @@ -115,12 +115,6 @@ connection.client = None connection.close() - def is_alive(self, connection): - return connection.is_alive() - - def verify_connection(self, connection): - return connection.channels is not None and self.is_alive(connection) - def eventmap(self, connection): return {connection.sock: self.client.drain_nowait} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/transport/redis.py new/kombu-2.5.10/kombu/transport/redis.py --- old/kombu-2.5.8/kombu/transport/redis.py 2013-03-21 17:02:36.000000000 +0100 +++ new/kombu-2.5.10/kombu/transport/redis.py 2013-04-11 18:57:56.000000000 +0200 @@ -27,6 +27,11 @@ from kombu.utils import cached_property, uuid from kombu.utils.eventio import poll, READ, ERR +NO_ROUTE_ERROR = """ +Cannot route message for exchange %r: Table empty or key no longer exists. +Probably the key (%r) has been removed from the Redis database. +""" + try: from billiard.util import register_after_fork except ImportError: @@ -572,9 +577,7 @@ with self.conn_or_acquire() as client: values = client.smembers(key) if not values: - raise InconsistencyError( - 'Queue list empty or key does not exist: %r' % ( - self.keyprefix_queue % exchange)) + raise InconsistencyError(NO_ROUTE_ERROR % (exchange, key)) return [tuple(val.split(self.sep)) for val in values] def _purge(self, queue): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/utils/__init__.py new/kombu-2.5.10/kombu/utils/__init__.py --- old/kombu-2.5.8/kombu/utils/__init__.py 2013-03-21 15:01:12.000000000 +0100 +++ new/kombu-2.5.10/kombu/utils/__init__.py 2013-04-11 18:57:56.000000000 +0200 @@ -220,7 +220,8 @@ raise if callback: callback() - tts = errback(exc, interval_range, retries) if errback else None + tts = (errback(exc, interval_range, retries) if errback + else next(interval_range)) if tts: for i in range(int(tts / interval_step)): if callback: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu/utils/text.py new/kombu-2.5.10/kombu/utils/text.py --- old/kombu-2.5.8/kombu/utils/text.py 1970-01-01 01:00:00.000000000 +0100 +++ new/kombu-2.5.10/kombu/utils/text.py 2013-04-11 15:53:01.000000000 +0200 @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import absolute_import + +from difflib import SequenceMatcher + + +def fmatch_iter(needle, haystack, min_ratio=0.6): + for key in haystack: + ratio = SequenceMatcher(None, needle, key).ratio() + if ratio >= min_ratio: + yield ratio, key + + +def fmatch_best(needle, haystack, min_ratio=0.6): + try: + return sorted( + fmatch_iter(needle, haystack, min_ratio), reverse=True, + )[0][1] + except IndexError: + pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu.egg-info/PKG-INFO new/kombu-2.5.10/kombu.egg-info/PKG-INFO --- old/kombu-2.5.8/kombu.egg-info/PKG-INFO 2013-03-21 17:27:18.000000000 +0100 +++ new/kombu-2.5.10/kombu.egg-info/PKG-INFO 2013-04-11 19:12:29.000000000 +0200 @@ -1,16 +1,18 @@ Metadata-Version: 1.1 Name: kombu -Version: 2.5.8 +Version: 2.5.10 Summary: Messaging Framework for Python Home-page: http://kombu.readthedocs.org Author: Ask Solem Author-email: a...@celeryproject.org License: UNKNOWN -Description: ======================================== +Description: .. _kombu-index: + + ======================================== kombu - Messaging Framework for Python ======================================== - :Version: 2.5.8 + :Version: 2.5.10 `Kombu` is a messaging framework for Python. @@ -81,6 +83,8 @@ .. _`librabbitmq`: http://pypi.python.org/pypi/librabbitmq + .. _transport-comparison: + Transport Comparison ==================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu.egg-info/SOURCES.txt new/kombu-2.5.10/kombu.egg-info/SOURCES.txt --- old/kombu-2.5.8/kombu.egg-info/SOURCES.txt 2013-03-21 17:27:18.000000000 +0100 +++ new/kombu-2.5.10/kombu.egg-info/SOURCES.txt 2013-04-11 19:12:29.000000000 +0200 @@ -73,6 +73,7 @@ docs/reference/kombu.utils.functional.rst docs/reference/kombu.utils.limits.rst docs/reference/kombu.utils.rst +docs/reference/kombu.utils.text.rst docs/reference/kombu.utils.url.rst docs/userguide/connections.rst docs/userguide/consumers.rst @@ -211,6 +212,7 @@ kombu/utils/finalize.py kombu/utils/functional.py kombu/utils/limits.py +kombu/utils/text.py kombu/utils/url.py requirements/default.txt requirements/docs.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/kombu.egg-info/requires.txt new/kombu-2.5.10/kombu.egg-info/requires.txt --- old/kombu-2.5.8/kombu.egg-info/requires.txt 2013-03-21 17:27:18.000000000 +0100 +++ new/kombu-2.5.10/kombu.egg-info/requires.txt 2013-04-11 19:12:29.000000000 +0200 @@ -1,2 +1,2 @@ anyjson>=0.3.3 -amqp>=1.0.10,<1.1.0 \ No newline at end of file +amqp>=1.0.11,<1.1.0 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kombu-2.5.8/requirements/default.txt new/kombu-2.5.10/requirements/default.txt --- old/kombu-2.5.8/requirements/default.txt 2013-03-21 16:31:01.000000000 +0100 +++ new/kombu-2.5.10/requirements/default.txt 2013-04-11 18:57:56.000000000 +0200 @@ -1,2 +1,2 @@ anyjson>=0.3.3 -amqp>=1.0.10,<1.1.0 +amqp>=1.0.11,<1.1.0 -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org