Skip to content
Browse files

Merge branch '2.3'

  • Loading branch information...
2 parents 671c282 + db1af56 commit 597c35789e9b5d066c4284334f5d34e1949f2a19 @ask ask committed Aug 5, 2012
View
21 Changelog
@@ -4,6 +4,27 @@
Change history
================
+.. _version-2.3.2:
+
+2.3.2
+=====
+:release-date: 2012-08-01 06:00 P.M BST
+
+- Fixes problem with deserialization in Python 3.
+
+.. _version-2.3.1:
+
+2.3.1
+=====
+:release-date: 2012-08-01 04:00 P.M BST
+
+- librabbitmq: Can now handle messages that does not have a
+ content_encoding/content_type set (Issue #149).
+
+ Fix contributed by C Anthony Risinger.
+
+- Beanstalk: Now uses localhost by default if the URL does not contain a host.
+
.. _version-2.3.0:
2.3.0
View
2 README.rst
@@ -2,7 +2,7 @@
kombu - Messaging Framework for Python
========================================
-:Version: 2.3.0
+:Version: 2.3.2
`Kombu` is a messaging framework for Python.
View
2 kombu/__init__.py
@@ -1,7 +1,7 @@
"""Messaging Framework for Python"""
from __future__ import absolute_import
-VERSION = (2, 3, 0)
+VERSION = (2, 3, 2)
__version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:])
__author__ = 'Ask Solem'
__contact__ = 'ask@celeryproject.org'
View
4 kombu/clocks.py
@@ -11,7 +11,7 @@
from __future__ import absolute_import
from __future__ import with_statement
-from threading import Lock
+import threading
__all__ = ['LamportClock']
@@ -57,7 +57,7 @@ class LamportClock(object):
def __init__(self, initial_value=0):
self.value = initial_value
- self.mutex = Lock()
+ self.mutex = threading.Lock()
def adjust(self, other):
with self.mutex:
View
3 kombu/compat.py
@@ -19,6 +19,9 @@
__all__ = ['Publisher', 'Consumer']
+# XXX compat attribute
+entry_to_queue = Queue.from_dict
+
def _iterconsume(connection, consumer, no_ack=False, limit=None):
consumer.consume(no_ack=no_ack)
View
2 kombu/compression.py
@@ -38,7 +38,7 @@ def register(encoder, decoder, content_type, aliases=[]):
def encoders():
"""Returns a list of available compression methods."""
- return _encoders.keys()
+ return list(_encoders)
def get_encoder(t):
View
12 kombu/serialization.py
@@ -58,20 +58,24 @@ def _decode(t, coding):
# cPickle.loads does not support buffer() objects,
# but we can just create a StringIO and use load.
if sys.version_info[0] == 3:
- from io import StringIO
+ from io import BytesIO
else:
try:
- from cStringIO import StringIO # noqa
+ from cStringIO import StringIO as BytesIO # noqa
except ImportError:
- from StringIO import StringIO # noqa
+ from StringIO import StringIO as BytesIO # noqa
+
+#: 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))
#: 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):
- return load(StringIO(s))
+ return load(BytesIO(s))
class SerializerRegistry(object):
View
2 kombu/tests/transport/virtual/test_base.py
@@ -66,7 +66,7 @@ def _restore(self, message):
self.q.append(i + 1, uuid())
self.assertFalse(self.q.can_consume())
- tag1 = self.q._delivered.keys()[0]
+ tag1 = iter(self.q._delivered).next()
self.q.ack(tag1)
self.assertTrue(self.q.can_consume())
View
4 kombu/transport/redis.py
@@ -76,7 +76,7 @@ def append(self, message, delivery_tag):
super(QoS, self).append(message, delivery_tag)
def restore_unacked(self):
- for tag in self._delivered.iterkeys():
+ for tag in self._delivered:
self.restore_by_tag(tag)
self._delivered.clear()
@@ -481,7 +481,7 @@ def close(self):
self.connection.cycle.discard(self)
# delete fanout bindings
- for queue in self._fanout_queues.iterkeys():
+ for queue in self._fanout_queues:
if queue in self.auto_delete_queues:
self.queue_delete(queue)
View
4 kombu/transport/virtual/__init__.py
@@ -433,7 +433,7 @@ def queue_bind(self, queue, exchange=None, routing_key='', arguments=None,
self._queue_bind(exchange, *meta)
def list_bindings(self):
- for exchange in self.get_exchanges():
+ for exchange in self.state.exchanges:
table = self.get_table(exchange)
for routing_key, pattern, queue in table:
yield queue, exchange, routing_key
@@ -512,7 +512,7 @@ def basic_qos(self, prefetch_size=0, prefetch_count=0,
self.qos.prefetch_count = prefetch_count
def get_exchanges(self):
- return self.state.exchanges.keys()
+ return list(self.state.exchanges)
def get_table(self, exchange):
"""Get table of bindings for `exchange`."""

0 comments on commit 597c357

Please sign in to comment.
Something went wrong with that request. Please try again.