rq / rq-scheduler

A lightweight library that adds job scheduling capabilities to RQ (Redis Queue)
MIT License
1.43k stars 230 forks source link

Python 3.6 support #162

Open CBienRoxane opened 7 years ago

CBienRoxane commented 7 years ago

Hi when I tried to use get_jobs() i got

File "/home/roxane/Cbien/venvs/auth/lib/python3.6/site-packages/rq_scheduler/scheduler.py", line 251, in get_jobs
    job_id = job_id.decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'

I use python3.6, and it seems you don't support it, is it planned ?

a-huy commented 6 years ago

Hi CBienRoxane,

This particular code will only break if your Redis connection object has decode_responses set to True. As a workaround, make sure that your connection object wasn't created with decode_responses=True passed in.

The rq_scheduler code expects the result of the Redis query to be a bytes object (which is why it's calling decode().