summaryrefslogtreecommitdiff
path: root/kombu/transport/SQS.py
diff options
context:
space:
mode:
authorAsk Solem <ask@celeryproject.org>2011-10-25 22:16:27 +0100
committerAsk Solem <ask@celeryproject.org>2011-10-25 22:16:27 +0100
commit419d08bee63c7237f828a5e0169abf76c84421e4 (patch)
treec0ba1e1c65e41f8272f1e98f49aea30d97e478a0 /kombu/transport/SQS.py
parentb4b5d18f911f4f76ab005fc4a86124ac36402946 (diff)
downloadkombu-419d08bee63c7237f828a5e0169abf76c84421e4.tar.gz
str.encode does not accept kwargs in Py < 2.7. Closes #68. Thanks to mbudde
Diffstat (limited to 'kombu/transport/SQS.py')
-rw-r--r--kombu/transport/SQS.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/kombu/transport/SQS.py b/kombu/transport/SQS.py
index f9ee2c75..a17b13cd 100644
--- a/kombu/transport/SQS.py
+++ b/kombu/transport/SQS.py
@@ -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."""