You have been subscribed to a public bug:

Bug 1190526 has an associated HookError_ubuntu.txt containing:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport/report.py", line 197, in _run_hook
    symb['add_info'](report, ui)
  File "/usr/share/apport/general-hooks/ubuntu.py", line 92, in add_info
    apport.hookutils.attach_conffiles(report, package, ui=ui)
  File "/usr/lib/python3/dist-packages/apport/hookutils.py", line 132, in 
attach_conffiles
    if contents == '[deleted]' or contents.startswith('[inaccessible'):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str


The python3-specific problem seems to be that startswith() is expecting a value 
of the same type as 'contents'. The code assumes contents is a string, but its 
is a byte tuple.

A fix therefore might be "b'[inaccessible'" like this:

    if contents == '[deleted]' or contents.startswith(b'[inaccessible'):

However, I haven't checked all other instances of startswith().

** Affects: apport (Ubuntu)
     Importance: Undecided
         Status: In Progress

-- 
hookutils.py usage of startswith() assumes strings, but objects are bytes
https://bugs.launchpad.net/bugs/1192899
You received this bug notification because you are a member of Ubuntu Bugs, 
which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to