You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if the args contain some non ascii chars sometimes flush-queue stops with:
File "/....../lib/python3.4/site-packages/async/management/commands/flush_queue.py", line 63, in run
print ("%s: %s" % (job.id, job))
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 137: ordinal not in range(128)
the args in the above failure where: ["fiche-de-suivi-mensuel-collines", "ben", {"query": "l\u00e9a", "group": null, "status": null}, {"host": "ben.mdca.wfp.org", "is_secure": false}, false, false]
the job finished but was never marked completed as it broke on print job
The text was updated successfully, but these errors were encountered:
Python and Unicode. Gotta love it! This is Python 3? I thought that was supposed to fix Python's terrible Unicode support. 👎 For 2 I would suggest trying
print (u"%s: %s" % (job.id, job))
But I don't know what the right thing for 3 is....
It is for python 3.
I have looked more in to it and realise that the issue is in the unicode() of the job
somewhere here:
class Job(models.Model):
.
.
.
.
def __unicode__(self):
# __unicode__: Instance of 'bool' has no 'items' member
# pylint: disable=E1103
arglist = simplejson.loads(self.args)
arglist = [repr(s) for s in arglist]
kwargs = simplejson.loads(self.kwargs)
kwargs = sorted([u"%s=%s" % (k, repr(v)) for k, v in kwargs.items()])
args = u', '.join(arglist + kwargs)
if the args contain some non ascii chars sometimes flush-queue stops with:
the args in the above failure where:
["fiche-de-suivi-mensuel-collines", "ben", {"query": "l\u00e9a", "group": null, "status": null}, {"host": "ben.mdca.wfp.org", "is_secure": false}, false, false]
the job finished but was never marked completed as it broke on print job
The text was updated successfully, but these errors were encountered: