Working on cr-xml from cosmic-ray 5.5.0, I noticed the following error:
Traceback (most recent call last):
File "/home/fr33ky/.local/bin/cr-xml", line 10, in <module>
sys.exit(report_xml())
File "/home/fr33ky/.local/lib/python3.7/site-packages/cosmic_ray/tools/xml.py", line 21, in report_xml
xml_elem = _create_xml_report(db)
File "/home/fr33ky/.local/lib/python3.7/site-packages/cosmic_ray/tools/xml.py", line 43, in _create_xml_report
subelement = _update_element_with_result(subelement, result)
File "/home/fr33ky/.local/lib/python3.7/site-packages/cosmic_ray/tools/xml.py", line 74, in _update_element_with_result
error_elem.text = str(data) + "\n".join(result.diff)
TypeError: can only join an iterable
Checking sources I noticed that, in src/cosmic_ray/worker.py, from line 77, a WorkResult is returned with no diff set.
There are then 3 solutions:
- set
diff in worker.py even for exception
- check if diff is not null in
src/cosmic_ray/tools/xml.py (_update_element_with_result)
- both