str.encode does not accept kwargs in Py < 2.7. Closes #68. Thanks to mbudde

This commit is contained in:
Ask Solem 2011-10-25 22:16:27 +01:00
parent b4b5d18f91
commit 419d08bee6
1 changed files with 2 additions and 1 deletions

View File

@ -25,6 +25,7 @@ from boto.sqs.message import Message
from kombu.transport import virtual
from kombu.utils import cached_property, uuid
from kombu.utils.encoding import safe_str
# dots are replaced by dash, all other punctuation
@ -153,7 +154,7 @@ class Channel(virtual.Channel):
def entity_name(self, name, table=CHARS_REPLACE_TABLE):
"""Format AMQP queue name into a legal SQS queue name."""
return name.encode(errors="replace").translate(table)
return safe_str(name).translate(table)
def _new_queue(self, queue, **kwargs):
"""Ensures a queue exists in SQS."""