method OptionParser#exit() from optparse.py causes UnicodeEncodeError on apport-retrace

Bug #905831 reported by jbatista
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python2.6 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Running apport-retrace exits with an UnicodeEncodeError simply by running from the console (see bug #905826 for example) on Ubuntu Lucid, amd64.
The line is from method exit() from class OptionParser on file optparse.py.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: python2.6-minimal 2.6.5-1ubuntu6
ProcVersionSignature: Ubuntu 2.6.32-36.79-generic 2.6.32.46+drm33.20
Uname: Linux 2.6.32-36-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Sat Dec 17 23:37:49 2011
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100429)
ProcEnviron:
 LANGUAGE=pt:pt_PT:pt_BR:en
 PATH=(custom, user)
 LANG=pt_PT.utf8
 SHELL=/bin/bash
SourcePackage: python2.6

Revision history for this message
jbatista (jmnbatista) wrote :
Revision history for this message
jbatista (jmnbatista) wrote :

Can be solved by editing method exit() in class OptionParser of file /usr/lib/python2.6/optparse.py so that the line
  sys.stderr.write(msg)
reads instead, for example:
  sys.stderr.write(msg.encode('utf-8'))

This workaround quenches the error in apport-retrace.

Revision history for this message
dino99 (9d9) wrote :

Support for this version has ended

Changed in python2.6 (Ubuntu):
status: New → Invalid
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.