use utf-8 instead of ascii

main
Alex Morega 12 years ago
parent 5b630b1e22
commit 328e7611d3

@ -61,7 +61,7 @@ else:
if v is None:
return None
elif isinstance(v, bytes):
return v.decode('ascii')
return v.decode('utf-8')
elif isinstance(v, str):
return v
else:

@ -210,7 +210,7 @@ class Job(object):
@classmethod
def key_for(cls, job_id):
"""The Redis key that is used to store job hash under."""
return b'rq:job:' + job_id.encode('ascii')
return b'rq:job:' + job_id.encode('utf-8')
@property
def key(self):

@ -108,7 +108,7 @@ class TestJob(RQTestCase):
job.save()
expected_date = strip_milliseconds(job.created_at)
stored_date = self.testconn.hget(job.key, 'created_at').decode('ascii')
stored_date = self.testconn.hget(job.key, 'created_at').decode('utf-8')
self.assertEquals(
times.to_universal(stored_date),
expected_date)
@ -124,7 +124,7 @@ class TestJob(RQTestCase):
job.save()
expected_date = strip_milliseconds(job.created_at)
stored_date = self.testconn.hget(job.key, 'created_at').decode('ascii')
stored_date = self.testconn.hget(job.key, 'created_at').decode('utf-8')
self.assertEquals(
times.to_universal(stored_date),
expected_date)

Loading…
Cancel
Save