[Bug 1030483] Re: apport-collect crash when sending log file and using a non-English locale ("TypeError: 'unicode' does not have the buffer interface")

Daniel van Vugt daniel.van.vugt at canonical.com
Wed Nov 8 02:57:50 UTC 2017


** Summary changed:

- apport-collect crash when sending log file and using a non-English locale
+ apport-collect crash when sending log file and using a non-English locale ("TypeError: 'unicode' does not have the buffer interface")

-- 
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/1030483

Title:
  apport-collect crash when sending log file and using a non-English
  locale ("TypeError: 'unicode' does not have the buffer interface")

Status in apport package in Ubuntu:
  Confirmed

Bug description:
  In the process of updating #1030151 I was hit by a bug in apport-collect. When doing 
  apport-collect 1030151
  in a root console the apport-collect would crash with following trace back : 

  Traceback (most recent call last):
    File "/usr/share/apport/apport-gtk", line 587, in <module>
      app.run_argv()
    File "/usr/lib/python2.7/dist-packages/apport/ui.py", line 634, in run_argv
      return self.run_update_report()
    File "/usr/lib/python2.7/dist-packages/apport/ui.py", line 554, in run_update_report
      attachment_comment='apport information')
    File "/usr/lib/python2.7/dist-packages/apport/crashdb_impl/launchpad.py", line 356, in update
      report.write_mime(mime, skip_keys=skip_keys)
    File "/usr/lib/python2.7/dist-packages/problem_report.py", line 505, in write_mime
      attach_value = CompressedValue(v, k).gzipvalue
    File "/usr/lib/python2.7/dist-packages/problem_report.py", line 44, in __init__
      self.set_value(value)
    File "/usr/lib/python2.7/dist-packages/problem_report.py", line 50, in set_value
      gzip.GzipFile(self.name, mode='wb', fileobj=out).write(value)
    File "/usr/lib/python2.7/gzip.py", line 131, in __init__
      self._write_gzip_header()
    File "/usr/lib/python2.7/gzip.py", line 176, in _write_gzip_header
      self.fileobj.write(fname + '\000')
  TypeError: 'unicode' does not have the buffer interface

  Calling apport-collect with LC_ALL=C or LANG=C as suggest by Edward
  Donovan didn't solve the issue.

  I used this workaround : in /usr/lib/python2.7/dist-packages/problem_report.py I replaced line  50 :
  gzip.GzipFile(self.name, mode='wb', fileobj=out).write(value)
  by :
  gzip.GzipFile(self.name.encode('UTF-8'), mode='wb', fileobj=out).write(value.encode('UTF-8'))

  It's a quick and dirty hack but maybe it will help the developpers to
  trully solve the issue.

  Cheers !

  ProblemType: Bug
  DistroRelease: Ubuntu 12.10
  Package: apport 2.4-0ubuntu6
  ProcVersionSignature: Ubuntu 3.5.0-6.6-generic 3.5.0
  Uname: Linux 3.5.0-6-generic x86_64
  ApportLog:
   
  ApportVersion: 2.4-0ubuntu6
  Architecture: amd64
  CrashReports:
   644:0:110:0:2012-07-29 12:14:17.260971307 +0200:2012-07-29 12:14:17.260971307 +0200:/var/crash/_sbin_plymouthd.0.upload
   600:105:110:0:2012-07-29 12:14:25.388971230 +0200:2012-07-29 12:14:25.388971230 +0200:/var/crash/_sbin_plymouthd.0.uploaded
   640:0:110:1232461:2012-07-29 12:08:44.732974000 +0200:2012-07-29 12:14:18.284971294 +0200:/var/crash/_sbin_plymouthd.0.crash
  Date: Sun Jul 29 12:53:17 2012
  InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Alpha amd64 (20120627)
  PackageArchitecture: all
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   LANG=fr_FR.UTF-8
   SHELL=/bin/bash
  SourcePackage: apport
  UpgradeStatus: No upgrade log present (probably fresh install)

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



More information about the foundations-bugs mailing list