Closed brouberol closed 9 years ago
@brouberol Great bug report! Thanks for taking the time to include all the examples code.
I think the best bet would be to extend kwargs_to_list
to force str/unicodes into one standard form
https://github.com/TrackMaven/celery-once/blob/dbce7508536eb8a2d3184dd2dded42a86357882c/celery_once/helpers.py#L37
Will hopefully get around to patching this week!
Heh, no worries. No example, no patch, right :smile:
Let me know if there is anything I can do to make this work. I think we may need to recursively iterate over each kwarg and force convert any str to unicode (in the python2 sense). Does that seem right to you?
I'm facing an issue when sending a keyword argument containing a list of strings.
The task is called as
The
getcallargs(self.run, *args, **kwargs)
call, returns the following dict:which generates the key
When the task call returns, the
getcallargs(self.run, *args, **kwargs)
call now returns the following dict:which generates the key
The (subtle) difference is that inspect.getcallargs added the "u" prefix in front of each string in the
filepaths
kwargs. As this results in two different keys, I can only delay a task once, until the lock expires.