Comment 7 for bug 1548421

Revision history for this message
Brian Murray (brian-murray) wrote : Re: python stacktrace during 'apport-bug'

With the old version of the general ubuntu hook we get a traceback:

 $ python3 data/general-hooks/ubuntu.py ~/source-trees/bugpatterns/master/report-1581664.crash
Traceback (most recent call last):
  File "data/general-hooks/ubuntu.py", line 494, in <module>
    add_info(new_report, None)
  File "data/general-hooks/ubuntu.py", line 66, in add_info
    check_attachment_for_errors(report, attachment)
  File "data/general-hooks/ubuntu.py", line 170, in check_attachment_for_errors
    trim_dpkg_log(report)
  File "data/general-hooks/ubuntu.py", line 468, in trim_dpkg_log
    report['DpkgTerminalLog'] = '\n'.join([str(line.encode('utf-8')) for line in lines])
  File "data/general-hooks/ubuntu.py", line 468, in <listcomp>
    report['DpkgTerminalLog'] = '\n'.join([str(line.encode('utf-8')) for line in lines])
AttributeError: 'bytes' object has no attribute 'encode'

Using apport from -proposed we see:

 $ python3 /usr/share/apport/general-hooks/ubuntu.py ~/source-trees/bugpatterns/master/report-1581664.crash
dpkg-query: no packages found matching kaccounts-providers
0 items changed