gdk-update-viewer UnicodeDecodeError

Bug #420683 reported by Daniel Hermansson
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
packagekit-gnome (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: packagekit-gnome

When i started gdk-update-viewer i got this error in a dialog:

Error Type: <type 'exceptions.UnicodeDecodeError'>
Error Value: 'ascii' codec can't decode byte 0xc3 in position 7: ordinal not in range(128)
  File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 1941, in <module>
    main()
  File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 1938, in main
    run(args, options.single)
  File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 1900, in run
    backend.dispatcher(args)
  File : /usr/lib/python2.6/dist-packages/packagekit/backend.py, line 647, in dispatcher
    self.dispatch_command(args[0], args[1:])
  File : /usr/lib/python2.6/dist-packages/packagekit/backend.py, line 537, in dispatch_command
    self.get_update_detail(package_ids)
  File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 750, in get_update_detail
    updated)
  File : /usr/lib/python2.6/dist-packages/packagekit/backend.py, line 242, in update_detail
    changelog, state, issued, updated))

ProblemType: Bug
Architecture: amd64
Date: Fri Aug 28 19:57:57 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/bin/gpk-update-viewer
Package: packagekit-gnome 2.27.2-0ubuntu2 [modified: usr/bin/gpk-application usr/bin/gpk-backend-status usr/bin/gpk-install-catalog usr/bin/gpk-install-local-file usr/bin/gpk-install-mime-type usr/bin/gpk-install-package-name usr/bin/gpk-install-provide-file usr/bin/gpk-log usr/bin/gpk-prefs usr/bin/gpk-repo usr/bin/gpk-service-pack usr/bin/gpk-update-icon usr/bin/gpk-update-viewer]
ProcEnviron:
 PATH=(custom, user)
 LANG=sv_SE.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-6.26-generic
SourcePackage: packagekit-gnome
Uname: Linux 2.6.31-6-generic x86_64

Revision history for this message
Daniel Hermansson (daniel.h) wrote :
Ulf Rompe (rompe)
Changed in packagekit-gnome (Ubuntu):
status: New → Confirmed
Revision history for this message
Ulf Rompe (rompe) wrote :

This bug persists in 2.27.2-0ubuntu3. Line number are slightly different of course:

Error Type: <type 'exceptions.UnicodeDecodeError'>
Error Value: 'ascii' codec can't decode byte 0xc3 in position 14: ordinal not in range(128)
  File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 1948, in <module>
    main()
  File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 1945, in main
    run(args, options.single)
  File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 1907, in run
    backend.dispatcher(args)
  File : /usr/lib/python2.6/dist-packages/packagekit/backend.py, line 636, in dispatcher
    self.dispatch_command(args[0], args[1:])
  File : /usr/lib/python2.6/dist-packages/packagekit/backend.py, line 537, in dispatch_command
    self.get_update_detail(package_ids)
  File : /usr/share/PackageKit/helpers/apt/aptBackend.py, line 753, in get_update_detail
    updated)
  File : /usr/lib/python2.6/dist-packages/packagekit/backend.py, line 242, in update_detail
    changelog, state, issued, updated))

Cause of the problem:
For packages without changelogs available (which is the case for PPAs) a message stating this circumstance is printed instead. This string is internationalized and may contain non-ascii characters in languages != C. For example, in de_DE.UTF-8 the "changelog" variable contains 'Die Liste der \xc3\x84nderungen ist momentan nicht verf\xc3\xbcgbar.' Note that it seems to be a plain string, not a Unicode string. I traced this down using this simple patch:

--- /usr/lib/python2.6/dist-packages/packagekit/backend.py.orig 2009-09-07 06:54:18.000000000 +0200
+++ /usr/lib/python2.6/dist-packages/packagekit/backend.py 2009-09-07 07:55:02.000000000 +0200
@@ -236,6 +236,10 @@
         @param issued:
         @param updated:
         '''
+ try:
+ changelog = changelog.encode("ascii", "replace")
+ except UnicodeDecodeError:
+ changelog = repr(changelog)
         self._send("updatedetail\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t"
                   "%s" % (package_id, updates, obsoletes, vendor_url,
                           bugzilla_url, cve_url, restart, update_text,

Revision history for this message
Ulf Rompe (rompe) wrote :

Oops, I managed to mess up the indentation of the debug patch. Attaching it instead.

Revision history for this message
Ulf Rompe (rompe) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.