Skip to content

Commit a84265f

Browse files
committed
celery#2654 - couchbase - changing the key_t to str_t
Couchbase python API needs to have str type not bytes for the keys. We use kombu.utils.encoding.str_t to make it compatible with Python 2 and 3
1 parent 365f561 commit a84265f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

celery/backends/couchbase.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
except ImportError:
1818
Couchbase = Connection = NotFoundError = None # noqa
1919

20+
from kombu.utils.encoding import str_t
2021
from kombu.utils.url import _parse_url
2122

2223
from celery.exceptions import ImproperlyConfigured
@@ -38,6 +39,9 @@ class CouchBaseBackend(KeyValueStoreBackend):
3839
timeout = 2.5
3940
transcoder = None
4041
# supports_autoexpire = False
42+
43+
# Use str as couchbase key not bytes
44+
key_t = str_t
4145

4246
def __init__(self, url=None, *args, **kwargs):
4347
"""Initialize CouchBase backend instance.

0 commit comments

Comments
 (0)