cobertura-clover-transform
cobertura-clover-transform copied to clipboard
str/bytes bug on Python3
$ python -V Python 3.5.2+
$ cobertura-clover-transform cobertura.xml b'<coverage generated ....snip...>\n'
So the problem is that on Python3 the xml document (which is a bytes) object is passed to print and comes out in repr form.
+1
Workarounds
If you want the output in a file, just use the -o
option:
cobertura-clover-transform cobertura.xml -o clover.xml
If you need the output on stdout:
temp_file=$(mktemp) && cobertura-clover-transform coverage.xml -o ${temp_file} && cat ${temp_file}; rm ${temp_file}; unset temp_file
If you want to pipe the output to another process:
temp_file=$(mktemp) && cobertura-clover-transform coverage.xml -o ${temp_file} && cat ${temp_file} | ANOTHER_PROCESS; rm ${temp_file}; unset temp_file