While this may fix it for DpkgTerminalLog, the fix is not generic so if
another attachment were to be a bytes object and a bug pattern were
written for that attachment we would get the same crash.  I think this
code in apport/report.py needs to modified:

            if c.hasChildNodes() and c.childNodes[0].nodeType == 
xml.dom.Node.TEXT_NODE: 
                regexp = c.childNodes[0].nodeValue
                v = report[key]
                if isinstance(v, problem_report.CompressedValue):
                    v = v.get_value()
                    regexp = regexp.encode('UTF-8')
                try:
                    re_c = re.compile(regexp)
                except:
                    continue
                if not re_c.search(v):
                    return None


** Changed in: apport (Ubuntu)
       Status: Fix Released => Triaged

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

Title:
  apport-gtk crashed with TypeError in _check_bug_pattern(): can't use a
  string pattern on a bytes-like object

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to