Comment 2 for bug 1018354

Revision history for this message
Daniel Manrique (roadmr) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This is probably related to string encoding, and seems to be a problem in run_templates.

Steps to reproduce:

echo "hello" | /usr/share/checkbox/scripts/run_templates -t -s 'cat /etc/passwd'

Expected result:
hello

Actual result:
Traceback (most recent call last):
  File "/usr/share/checkbox/scripts/run_templates", line 142, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/share/checkbox/scripts/run_templates", line 137, in main
    runner.process(args, options.shell)
  File "/usr/share/checkbox/scripts/run_templates", line 39, in process
    records = self.process_output(process.stdout)
  File "/usr/share/checkbox/scripts/run_templates", line 88, in process_output
    return template.load_file(output)
  File "/usr/lib/python3/dist-packages/checkbox/lib/template.py", line 73, in load_file
    for string in self._reader(file):
  File "/usr/lib/python3/dist-packages/checkbox/lib/template.py", line 35, in _reader
    lines = re.split(delimiter, buffer_old + buffer_new)
TypeError: Can't convert 'bytes' object to str implicitly

I'll set to triaged, importance: high as this is potentially affecting everyone. Thanks!