locationlabs / mockredis

mock for redis-py (NO LONGER SUPPORTED)
Apache License 2.0
227 stars 107 forks source link

Add encode in keys command to fix the support with django-redis-4.9.0 #139

Open jbagot opened 6 years ago

jbagot commented 6 years ago

Since django-redis has been updated to 4.9.0 is using CacheKey object like a pattern for the keys command. This caused an error in this line: pattern = pattern.decode('utf-8'). Then if before this line we can add the pattern = self._encode(pattern) we can avoid this. Also if the pattern is a normal string like the default '*' works.