[Bug 1582992] Re: broken apport hook: TypeError: Can't convert 'bytes' object to str implicitly

Brian Murray brian at ubuntu.com
Fri Mar 24 22:02:44 UTC 2017


Here's a test case that should be easily reproducible using the data in
this bug.  Use download-crash from the bugpatterns bzr branch to create
a crash file for this report e.g. ./download-crash 1582992. Then run the
following in python:

 $ python3          
Python 3.5.2+ (default, Sep 22 2016, 12:18:14) 
[GCC 6.2.0 20160927] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import apport
>>> report = apport.Report()
>>> f = open('report-1582992.crash', 'rb')
>>> report.load(f)
>>> from apport import hookutils
>>> hookutils.attach_mac_events(report, ['/usr/lib/libvirt/virt-aa-helper', '/usr/bin/libvirtd', 'libvirt-.*'])

This did not crash for me on yakkety.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/1582992

Title:
  broken apport hook: TypeError: Can't convert 'bytes' object to str
  implicitly

Status in apport package in Ubuntu:
  Incomplete
Status in libvirt package in Ubuntu:
  Invalid

Bug description:
  The apport hooks appear broken:

  # ubuntu-bug libvirt-bin
  /usr/share/apport/apport-gtk:16: PyGIWarning: Wnck was imported without specifying a version first. Use gi.require_version('Wnck', '3.0') before import to ensure that the right version gets loaded.
    from gi.repository import GLib, Wnck, GdkX11, Gdk
  Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
  ERROR: hook /usr/share/apport/package-hooks/source_libvirt.py crashed:
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/apport/report.py", line 197, in _run_hook
      symb['add_info'](report, ui)
  TypeError: add_info() takes 1 positional argument but 2 were given

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/apport/report.py", line 202, in _run_hook
      symb['add_info'](report)
    File "/usr/share/apport/package-hooks/source_libvirt.py", line 21, in add_info
      'libvirt-.*'])
    File "/usr/lib/python3/dist-packages/apport/hookutils.py", line 716, in attach_mac_events
      for match in re.findall(aa_re, report.get('KernLog', '') + report.get('AuditLog', '')):
  TypeError: Can't convert 'bytes' object to str implicitly

  
  Don't worry about the Wnck thing, that's bug 1580412.

  Thanks

  ProblemType: Bug
  DistroRelease: Ubuntu 16.04
  Package: libvirt-bin 1.3.1-1ubuntu10
  ProcVersionSignature: Ubuntu 4.4.0-21.37-generic 4.4.6
  Uname: Linux 4.4.0-21-generic x86_64
  NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
  ApportVersion: 2.20.1-0ubuntu2
  Architecture: amd64
  Date: Tue May 17 22:02:30 2016
  InstallationDate: Installed on 2012-10-18 (1307 days ago)
  InstallationMedia: Ubuntu 12.04.1 LTS "Precise Pangolin" - Release amd64 (20120823.1)
  ProcEnviron:
   LANGUAGE=en_US
   TERM=rxvt-unicode
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: libvirt
  UpgradeStatus: Upgraded to xenial on 2016-04-30 (17 days ago)
  modified.conffile..etc.libvirt.qemu.networks.default.xml: [modified]
  mtime.conffile..etc.libvirt.qemu.networks.default.xml: 2016-04-30T00:20:19.958268

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1582992/+subscriptions



More information about the foundations-bugs mailing list