'coercing to Unicode' failed in result submitting step

Bug #929794 reported by Spring Zhang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LAVA Dispatcher
New
Undecided
Unassigned

Bug Description

Refer to: http://validation.linaro.org/lava-server/scheduler/job/10805/log_file

Traceback (most recent call last):
  File "/srv/lava/instances/production/bin/lava-dispatch", line 77, in <module>
    job.run()
  File "/srv/lava/instances/production/local/lib/python2.7/site-packages/lava_dispatcher/job.py", line 141, in run
    (cmd['command'], unicode(err, 'ascii', 'replace'))
TypeError: coercing to Unicode: need string or buffer, OperationFailed found

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

It looks like we need something like this:

try:
   text = unicode(err)
except TypeError:
   text = str(err)
text = str.encode("UTF-8", "replace")

As calling unicode on exception instanced does not seem to convert them to a string representation by calling __unicode__ (sadly).

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

this problem should has been fixed by the fix of bug#925396.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.