If the task is called with a kwarg as a list of str, the serialization/deserialization step may (depending on the one used) convert it to a list unicode strings.
The repr of the list would then differ (eg "['a', 'b']" vs "[u'a', u'b']"), leading to two different redis keys.
To solve this issue, we recursively parse every kwarg list, and encode any python 2 unicode string into a byte string (str) using the UTF-8 codec.
Note that nothing is done for python3, as it does not use the u prefix by default.
If the task is called with a kwarg as a list of str, the serialization/deserialization step may (depending on the one used) convert it to a list unicode strings. The repr of the list would then differ (eg "['a', 'b']" vs "[u'a', u'b']"), leading to two different redis keys.
To solve this issue, we recursively parse every kwarg list, and encode any python 2 unicode string into a byte string (str) using the UTF-8 codec.
Note that nothing is done for python3, as it does not use the u prefix by default.