From f9978bc27cd81eb736ef02c0e3ba6e6a2751c85e Mon Sep 17 00:00:00 2001 From: SkyLothar Date: Sun, 6 Dec 2015 10:00:38 +0800 Subject: [PATCH 1/2] make sure state text_type --- rq/worker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rq/worker.py b/rq/worker.py index 4a8a60e..8bcb02f 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -114,7 +114,7 @@ class Worker(object): name = worker_key[len(prefix):] worker = cls([], name, connection=connection) queues = as_text(connection.hget(worker.key, 'queues')) - worker._state = connection.hget(worker.key, 'state') or '?' + worker._state = as_text(connection.hget(worker.key, 'state') or '?') worker._job_id = connection.hget(worker.key, 'current_job') or None if queues: worker.queues = [cls.queue_class(queue, connection=connection) From 70b5554566b09a1a0e70681dcb40e662f1cb0928 Mon Sep 17 00:00:00 2001 From: SkyLothar Date: Sun, 6 Dec 2015 10:34:07 +0800 Subject: [PATCH 2/2] make sure exc_info is text type --- rq/job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rq/job.py b/rq/job.py index ad1df2f..e39306a 100644 --- a/rq/job.py +++ b/rq/job.py @@ -413,7 +413,7 @@ class Job(object): self.started_at = to_date(as_text(obj.get('started_at'))) self.ended_at = to_date(as_text(obj.get('ended_at'))) self._result = unpickle(obj.get('result')) if obj.get('result') else None # noqa - self.exc_info = obj.get('exc_info') + self.exc_info = as_text(obj.get('exc_info')) self.timeout = int(obj.get('timeout')) if obj.get('timeout') else None self.result_ttl = int(obj.get('result_ttl')) if obj.get('result_ttl') else None # noqa self._status = as_text(obj.get('status') if obj.get('status') else None)